feat(auth): add callback, silent renew and logout routes
This commit is contained in:
15
src/pages/AuthCallbackPage.tsx
Normal file
15
src/pages/AuthCallbackPage.tsx
Normal file
@ -0,0 +1,15 @@
|
||||
import { useEffect } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { userManager } from 'auth/oidc'
|
||||
|
||||
|
||||
export default function AuthCallbackPage() {
|
||||
const navigate = useNavigate()
|
||||
useEffect(() => {
|
||||
userManager.signinRedirectCallback().then((res) => {
|
||||
const target = (res?.state as any)?.returnTo || '/'
|
||||
navigate(target, { replace: true })
|
||||
})
|
||||
}, [navigate])
|
||||
return <p>Completing sign-in…</p>
|
||||
}
|
||||
Reference in New Issue
Block a user