Skip to content

Commit e577dfc

Browse files
authored
fix(auth-info): autoInfo now updates when the authInfo is originally falsy (#75)
* fix(auth-info): autoInfo now updates when the authInfo is originally falsy In scenarios where the user starts off as logged out, and attempts to refresh the auth info manually, no changes to the store state will take place because the _state.authInfo will cause the check to fail * chore: bump version
1 parent 2ae1db4 commit e577dfc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "git",
66
"url": "https://github.com/PropelAuth/react"
77
},
8-
"version": "2.0.28",
8+
"version": "2.0.29",
99
"license": "MIT",
1010
"keywords": [
1111
"auth",

src/AuthContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function authInfoStateReducer(_state: AuthInfoState, action: AuthInfoStateAction
9191
loading: false,
9292
authInfo: action.authInfo,
9393
}
94-
} else if (_state.authInfo && _state.authInfo.accessToken !== action.authInfo.accessToken) {
94+
} else if (_state?.authInfo?.accessToken !== action.authInfo?.accessToken) {
9595
return {
9696
loading: false,
9797
authInfo: action.authInfo,

0 commit comments

Comments
 (0)