feat: auto redirect to the SSO login page

This commit is contained in:
Maël Gangloff
2025-12-07 14:32:48 +01:00
parent dd6c121936
commit dd5dba17fc
9 changed files with 29 additions and 3 deletions

View File

@@ -129,7 +129,7 @@ export default function App(): React.ReactElement {
}}
>
<Routes>
<Route path='/' element={<Navigate to='/login'/>}/>
<Route path='/' element={<Navigate to='/home'/>}/>
<Route path='/home' element={<TextPage resource='home.md'/>}/>
<Route path='/search/domain' element={<DomainSearchPage/>}/>

View File

@@ -30,7 +30,13 @@ export default function LoginPage() {
}
useEffect(() => {
getConfiguration().then(setConfiguration)
getConfiguration().then((configuration) => {
if(!configuration.registerEnabled && configuration.ssoLogin && configuration.ssoAutoRedirect) {
window.location.href = '/login/oauth'
return
}
setConfiguration(configuration)
})
}, [])
const grid = [

View File

@@ -105,6 +105,7 @@ export interface Watchlist {
}
export interface InstanceConfig {
ssoAutoRedirect: boolean
ssoLogin: boolean
limtedFeatures: boolean
registerEnabled: boolean