mirror of
https://github.com/unraid/api.git
synced 2025-12-31 13:39:52 -06:00
feat: remove sso if disabled on Unraid-API start
This commit is contained in:
@@ -15,6 +15,7 @@ import { WebSocket } from 'ws';
|
||||
import { logger } from '@app/core/log';
|
||||
import { setupLogRotation } from '@app/core/logrotate/setup-logrotate';
|
||||
import { setupAuthRequest } from '@app/core/sso/auth-request-setup';
|
||||
import { removeSso } from '@app/core/sso/sso-remove';
|
||||
import { setupSso } from '@app/core/sso/sso-setup';
|
||||
import { fileExistsSync } from '@app/core/utils/files/file-exists';
|
||||
import { environment, PORT } from '@app/environment';
|
||||
@@ -100,15 +101,18 @@ try {
|
||||
startMiddlewareListeners();
|
||||
|
||||
// If the config contains SSO IDs, enable SSO
|
||||
if (store.getState().config.remote.ssoSubIds) {
|
||||
try {
|
||||
try {
|
||||
if (store.getState().config.remote.ssoSubIds) {
|
||||
await setupAuthRequest();
|
||||
await setupSso();
|
||||
} catch (err) {
|
||||
logger.error(err, 'Failed to setup SSO');
|
||||
logger.info('SSO setup complete');
|
||||
} else {
|
||||
await removeSso();
|
||||
logger.info('SSO removed');
|
||||
}
|
||||
} catch (err) {
|
||||
logger.error('Failed to setup SSO with error: %o', err);
|
||||
}
|
||||
|
||||
// On process exit stop HTTP server
|
||||
exitHook((signal) => {
|
||||
console.log('exithook', signal);
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
import { ArrowDownTrayIcon, ArrowTopRightOnSquareIcon } from '@heroicons/vue/24/solid';
|
||||
import { BrandButton } from '@unraid/ui';
|
||||
import { CONNECT_FORUMS, CONTACT, DISCORD, WEBGUI_GRAPHQL } from '~/helpers/urls';
|
||||
import { useServerStore } from '~/store/server';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
Reference in New Issue
Block a user