2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-16 12:05:53 +00:00

refactor: remove preference-view (#8894)

* remove preference-view

* bump api

---------

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
Matthias Mair
2025-01-15 04:46:23 +01:00
committed by GitHub
parent fbe2131fa5
commit 89dfa0f6f9
8 changed files with 7 additions and 120 deletions

View File

@ -15,10 +15,6 @@ import {
} from '@tabler/icons-react';
import { t } from '@lingui/macro';
import { showNotification } from '@mantine/notifications';
import { api } from '../../App';
import { ApiEndpoints } from '../../enums/ApiEndpoints';
import { apiUrl } from '../../states/ApiState';
import type { Provider } from '../../states/states';
const brandIcons: { [key: string]: JSX.Element } = {
@ -37,24 +33,7 @@ const brandIcons: { [key: string]: JSX.Element } = {
export function SsoButton({ provider }: Readonly<{ provider: Provider }>) {
function login() {
// set preferred provider
api
.put(
apiUrl(ApiEndpoints.ui_preference),
{ preferred_method: 'pui' },
{ headers: { Authorization: '' } }
)
.then(() => {
// redirect to login
window.location.href = provider.login;
})
.catch(() => {
showNotification({
title: t`Error`,
message: t`Sign in redirect failed.`,
color: 'red'
});
});
window.location.href = provider.login;
}
return (

View File

@ -221,6 +221,5 @@ export enum ApiEndpoints {
error_report_list = 'error-report/',
project_code_list = 'project-code/',
custom_unit_list = 'units/',
ui_preference = 'web/ui_preference/',
notes_image_upload = 'notes-image-upload/'
}