mirror of
https://github.com/m1ngsama/FUJI.git
synced 2025-12-25 02:56:38 +00:00
23 lines
542 B
Text
23 lines
542 B
Text
<div></div>
|
|
|
|
<script>
|
|
import { makeLogtoClient } from "../utils/auth"
|
|
import LogtoClient from "@logto/browser"
|
|
|
|
const callbackHandler = async (logtoClient: LogtoClient) => {
|
|
try {
|
|
await logtoClient.handleSignInCallback(window.location.href)
|
|
if (!logtoClient.isAuthenticated) {
|
|
window.location.assign("/")
|
|
return
|
|
}
|
|
// Handle successful sign-in
|
|
window.location.assign("/")
|
|
}
|
|
catch (error) {
|
|
window.location.assign("/")
|
|
}
|
|
}
|
|
const logtoClient = makeLogtoClient()
|
|
callbackHandler(logtoClient)
|
|
</script>
|