Skip to content

Commit

Permalink
auth: fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
erikrakuscek committed Apr 18, 2024
1 parent cea0683 commit f4496c6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/auth/components/login-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ const LoginPanel: React.FC<PropsWithChildren & {
'/api/auth/generate-custom-token',
{ method: 'POST' }
).then(res => res.json())
if (res.success) {
onLoginChanged(res.token.token)
}
onLoginChanged(res.token?.token ?? null)
}
else if (redirectUrl) {
router.push(redirectUrl)
Expand Down Expand Up @@ -127,7 +125,7 @@ const LoginPanel: React.FC<PropsWithChildren & {
setIsLoading(true)
const res = await auth.logout()
if (res.success) {
succeed(false)
succeed()
}
setIsLoading(false)
}
Expand Down

0 comments on commit f4496c6

Please sign in to comment.