File tree Expand file tree Collapse file tree 2 files changed +2
-11
lines changed
packages/authgear-core/src Expand file tree Collapse file tree 2 files changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -103,10 +103,7 @@ export class _BaseAPIClient {
103103 throw new AuthgearError ( "missing delegate in api client" ) ;
104104 }
105105
106- const shouldRefresh = this . _delegate . shouldRefreshAccessToken ( ) ;
107- if ( shouldRefresh ) {
108- await this . _delegate . refreshAccessToken ( ) ;
109- }
106+ await this . _delegate . refreshAccessTokenIfNeeded ( ) ;
110107
111108 const request = new this . _Request ( input , init ) ;
112109
Original file line number Diff line number Diff line change @@ -151,16 +151,10 @@ export interface _APIClientDelegate {
151151 */
152152 getAccessToken ( ) : string | undefined ;
153153
154- /**
155- * Called by the API Client before sending HTTP request.
156- * If true is returned, refreshAccessToken() is then called.
157- */
158- shouldRefreshAccessToken ( ) : boolean ;
159-
160154 /**
161155 * Called by the API client to refresh the access token.
162156 */
163- refreshAccessToken ( ) : Promise < void > ;
157+ refreshAccessTokenIfNeeded ( ) : Promise < void > ;
164158}
165159
166160/**
You can’t perform that action at this time.
0 commit comments