mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: auto redirect to the SSO login page
This commit is contained in:
@@ -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/>}/>
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
@@ -105,6 +105,7 @@ export interface Watchlist {
|
||||
}
|
||||
|
||||
export interface InstanceConfig {
|
||||
ssoAutoRedirect: boolean
|
||||
ssoLogin: boolean
|
||||
limtedFeatures: boolean
|
||||
registerEnabled: boolean
|
||||
|
||||
Reference in New Issue
Block a user