File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -281,14 +281,19 @@ export class AuthService extends EventEmitter<AuthServiceEvents> {
281281 return
282282 }
283283
284- const previousState = this . state
285- this . sessionToken = await this . clerkCreateSessionToken ( )
286- this . state = "active-session"
284+ try {
285+ const previousState = this . state
286+ this . sessionToken = await this . clerkCreateSessionToken ( )
287+ this . state = "active-session"
287288
288- if ( previousState !== "active-session" ) {
289- console . log ( "[auth] Transitioned to active-session state" )
290- this . emit ( "active-session" , { previousState } )
291- this . fetchUserInfo ( )
289+ if ( previousState !== "active-session" ) {
290+ console . log ( "[auth] Transitioned to active-session state" )
291+ this . emit ( "active-session" , { previousState } )
292+ this . fetchUserInfo ( )
293+ }
294+ } catch ( error ) {
295+ console . error ( "[auth] Failed to refresh session" , error )
296+ throw error
292297 }
293298 }
294299
You can’t perform that action at this time.
0 commit comments