fix: authorization / registration
This commit is contained in:
@@ -18,6 +18,8 @@ export async function refreshAccessToken(): Promise<string> {
|
||||
})
|
||||
if (!res.ok) throw new Error('Unauthorized')
|
||||
const data = await res.json()
|
||||
tokenStore.set(data.access_token)
|
||||
return data.access_token as string
|
||||
if (data.access_token) {
|
||||
tokenStore.set(data.access_token)
|
||||
}
|
||||
return (data.access_token ?? data.result ?? true) as string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user