File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 55 "type" : " git" ,
66 "url" : " https://github.com/PropelAuth/javascript"
77 },
8- "version" : " 2.0.22 " ,
8+ "version" : " 2.0.23 " ,
99 "keywords" : [
1010 " auth" ,
1111 " user" ,
Original file line number Diff line number Diff line change @@ -191,6 +191,14 @@ export interface IAuthOptions {
191191 * Default false
192192 */
193193 disableRefreshOnFocus ?: boolean
194+
195+ /**
196+ * If true, disables the token refresh on initial page load.
197+ * Can help reduce duplicate token refresh requests.
198+ *
199+ * Default false
200+ */
201+ skipInitialFetch ?: boolean
194202}
195203
196204interface AccessTokenActiveOrgMap {
@@ -666,7 +674,9 @@ export function createClient(authOptions: IAuthOptions): IAuthClient {
666674 }
667675
668676 if ( authOptions . enableBackgroundTokenRefresh ) {
669- client . getAuthenticationInfoOrNull ( )
677+ if ( ! authOptions . skipInitialFetch ) {
678+ client . getAuthenticationInfoOrNull ( )
679+ }
670680 clientState . refreshInterval = window . setInterval ( client . getAuthenticationInfoOrNull , 60000 )
671681 }
672682 }
You can’t perform that action at this time.
0 commit comments