Skip to content

Commit

Permalink
fix: autoLogin false not respected on expired refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
soofstad committed Nov 4, 2024
1 parent 83fc894 commit c4c5b30
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/AuthContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ export const AuthProvider = ({ authConfig, children }: IAuthProvider) => {
}

function handleExpiredRefreshToken(initial = false): void {
// If it's the first page load, OR there is no sessionExpire callback, we trigger a new login
if (initial) return logIn(undefined, undefined, config.loginMethod)
if (config.autoLogin && initial) return logIn(undefined, undefined, config.loginMethod)

// TODO: Breaking change - remove automatic login during ongoing session
if (!config.onRefreshTokenExpire) return logIn(undefined, undefined, config.loginMethod)
Expand Down

0 comments on commit c4c5b30

Please sign in to comment.