Skip to content

Commit f4496c6

Browse files
committed
auth: fix type error
1 parent cea0683 commit f4496c6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/auth/components/login-panel.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@ const LoginPanel: React.FC<PropsWithChildren & {
6969
'/api/auth/generate-custom-token',
7070
{ method: 'POST' }
7171
).then(res => res.json())
72-
if (res.success) {
73-
onLoginChanged(res.token.token)
74-
}
72+
onLoginChanged(res.token?.token ?? null)
7573
}
7674
else if (redirectUrl) {
7775
router.push(redirectUrl)
@@ -127,7 +125,7 @@ const LoginPanel: React.FC<PropsWithChildren & {
127125
setIsLoading(true)
128126
const res = await auth.logout()
129127
if (res.success) {
130-
succeed(false)
128+
succeed()
131129
}
132130
setIsLoading(false)
133131
}

0 commit comments

Comments
 (0)