@@ -406,14 +406,18 @@ export class GlobalSettingsInitService {
406406 try {
407407 const settings = await Promise . all ( [
408408 GlobalSettingsService . get ( 'global.page_url' ) ,
409- GlobalSettingsService . get ( 'global.send_mail' )
409+ GlobalSettingsService . get ( 'global.send_mail' ) ,
410+ GlobalSettingsService . get ( 'global.enable_login' ) ,
411+ GlobalSettingsService . get ( 'global.enable_email_registration' )
410412 ] ) ;
411413
412- const [ pageUrl , sendMail ] = settings ;
414+ const [ pageUrl , sendMail , enableLogin , enableEmailRegistration ] = settings ;
413415
414416 return {
415417 pageUrl : pageUrl ?. value || 'http://localhost:5173' ,
416- sendMail : sendMail ?. value === 'true'
418+ sendMail : sendMail ?. value === 'true' ,
419+ enableLogin : enableLogin ?. value === 'true' ,
420+ enableEmailRegistration : enableEmailRegistration ?. value === 'true'
417421 } ;
418422 } catch ( error ) {
419423 console . error ( 'Failed to get Global configuration:' , error ) ;
@@ -446,6 +450,32 @@ export class GlobalSettingsInitService {
446450 return 'http://localhost:5173' ; // Default fallback
447451 }
448452 }
453+
454+ /**
455+ * Check if login is enabled (all types: email, GitHub, etc.)
456+ */
457+ static async isLoginEnabled ( ) : Promise < boolean > {
458+ try {
459+ const setting = await GlobalSettingsService . get ( 'global.enable_login' ) ;
460+ return setting ?. value === 'true' ;
461+ } catch ( error ) {
462+ console . error ( 'Failed to check if login is enabled:' , error ) ;
463+ return true ; // Default to enabled if there's an error
464+ }
465+ }
466+
467+ /**
468+ * Check if email registration is enabled
469+ */
470+ static async isEmailRegistrationEnabled ( ) : Promise < boolean > {
471+ try {
472+ const setting = await GlobalSettingsService . get ( 'global.enable_email_registration' ) ;
473+ return setting ?. value === 'true' ;
474+ } catch ( error ) {
475+ console . error ( 'Failed to check if email registration is enabled:' , error ) ;
476+ return true ; // Default to enabled if there's an error
477+ }
478+ }
449479}
450480
451481// Export the helper class
0 commit comments