mirror of
https://github.com/m1ngsama/FUJI.git
synced 2025-12-25 02:56:38 +00:00
30 lines
611 B
Text
30 lines
611 B
Text
<div></div>
|
|
|
|
<script>
|
|
import { makeLogtoClient } from "../utils/auth"
|
|
|
|
const callbackHandler = async (logtoClient) => {
|
|
console.log("callbackHandler")
|
|
try {
|
|
await logtoClient.handleSignInCallback(window.location.href)
|
|
if (!logtoClient.isAuthenticated) {
|
|
console.log("User not authenticated")
|
|
window.location.assign("/")
|
|
return
|
|
}
|
|
}
|
|
catch (error) {
|
|
console.log(error)
|
|
window.location.assign("/")
|
|
}
|
|
}
|
|
|
|
console.log("Callback page loaded")
|
|
try {
|
|
const logtoClient = makeLogtoClient()
|
|
callbackHandler(logtoClient)
|
|
}
|
|
catch (error) {
|
|
console.log(error)
|
|
}
|
|
</script>
|