1616 * under the License.
1717 */
1818
19- import { AuthenticationHelper } from './helpers' ;
20- import { AuthClientConfig , StrictAuthClientConfig } from './models' ;
19+ import { AuthenticationHelper } from './helpers' ;
20+ import { AuthClientConfig , StrictAuthClientConfig } from './models' ;
2121import OIDCDiscoveryConstants from '../constants/OIDCDiscoveryConstants' ;
2222import OIDCRequestConstants from '../constants/OIDCRequestConstants' ;
2323import PKCEConstants from '../constants/PKCEConstants' ;
24- import { AsgardeoAuthException } from '../errors/exception' ;
25- import { IsomorphicCrypto } from '../IsomorphicCrypto' ;
26- import { Crypto } from '../models/crypto' ;
27- import { ExtendedAuthorizeRequestUrlParams } from '../models/oauth-request' ;
28- import { OIDCDiscoveryApiResponse } from '../models/oidc-discovery' ;
29- import { OIDCEndpoints } from '../models/oidc-endpoints' ;
30- import { SessionData , UserSession } from '../models/session' ;
31- import { Storage , TemporaryStore } from '../models/store' ;
32- import { TokenResponse , IdToken , TokenExchangeRequestConfig } from '../models/token' ;
33- import { User } from '../models/user' ;
24+ import { AsgardeoAuthException } from '../errors/exception' ;
25+ import { IsomorphicCrypto } from '../IsomorphicCrypto' ;
26+ import { Crypto } from '../models/crypto' ;
27+ import { ExtendedAuthorizeRequestUrlParams } from '../models/oauth-request' ;
28+ import { OIDCDiscoveryApiResponse } from '../models/oidc-discovery' ;
29+ import { OIDCEndpoints } from '../models/oidc-endpoints' ;
30+ import { SessionData , UserSession } from '../models/session' ;
31+ import { Storage , TemporaryStore } from '../models/store' ;
32+ import { TokenResponse , IdToken , TokenExchangeRequestConfig } from '../models/token' ;
33+ import { User } from '../models/user' ;
3434import StorageManager from '../StorageManager' ;
3535import extractPkceStorageKeyFromState from '../utils/extractPkceStorageKeyFromState' ;
3636import generatePkceStorageKey from '../utils/generatePkceStorageKey' ;
@@ -119,7 +119,7 @@ export class AsgardeoAuthClient<T> {
119119 inputCryptoUtils : Crypto ,
120120 instanceID ?: number ,
121121 ) : Promise < void > {
122- const { clientId} = config ;
122+ const { clientId } = config ;
123123
124124 if ( ! this . instanceIdValue ) {
125125 this . instanceIdValue = 0 ;
@@ -214,7 +214,7 @@ export class AsgardeoAuthClient<T> {
214214 * @preserve
215215 */
216216 public async getSignInUrl ( requestConfig ?: ExtendedAuthorizeRequestUrlParams , userId ?: string ) : Promise < string > {
217- const authRequestConfig : ExtendedAuthorizeRequestUrlParams = { ...requestConfig } ;
217+ const authRequestConfig : ExtendedAuthorizeRequestUrlParams = { ...requestConfig } ;
218218
219219 delete authRequestConfig ?. forceInit ;
220220
@@ -228,7 +228,7 @@ export class AsgardeoAuthClient<T> {
228228 'JS-AUTH_CORE-GAU-NF01' ,
229229 'No authorization endpoint found.' ,
230230 'No authorization endpoint was found in the OIDC provider meta data from the well-known endpoint ' +
231- 'or the authorization endpoint passed to the SDK is empty.' ,
231+ 'or the authorization endpoint passed to the SDK is empty.' ,
232232 ) ;
233233 }
234234
@@ -242,7 +242,7 @@ export class AsgardeoAuthClient<T> {
242242
243243 if ( configData . enablePKCE ) {
244244 codeVerifier = this . cryptoHelper ?. getCodeVerifier ( ) ;
245- codeChallenge = this . cryptoHelper ?. getCodeChallenge ( codeVerifier ) ;
245+ codeChallenge = await this . cryptoHelper ?. getCodeChallenge ( codeVerifier ) ;
246246 await this . storageManager . setTemporaryDataParameter ( pkceKey , codeVerifier , userId ) ;
247247 }
248248
@@ -261,7 +261,7 @@ export class AsgardeoAuthClient<T> {
261261 responseMode : configData . responseMode ,
262262 scopes : processOpenIDScopes ( configData . scopes ) ,
263263 } ,
264- { key : pkceKey } ,
264+ { key : pkceKey } ,
265265 authRequestConfig ,
266266 ) ;
267267
@@ -326,7 +326,7 @@ export class AsgardeoAuthClient<T> {
326326 'JS-AUTH_CORE-RAT1-NF01' ,
327327 'Token endpoint not found.' ,
328328 'No token endpoint was found in the OIDC provider meta data returned by the well-known endpoint ' +
329- 'or the token endpoint passed to the SDK is empty.' ,
329+ 'or the token endpoint passed to the SDK is empty.' ,
330330 ) ;
331331 }
332332
@@ -422,7 +422,7 @@ export class AsgardeoAuthClient<T> {
422422 return Promise . resolve ( ) ;
423423 }
424424
425- const { wellKnownEndpoint} = configData as any ;
425+ const { wellKnownEndpoint } = configData as any ;
426426
427427 if ( wellKnownEndpoint ) {
428428 let response : Response ;
@@ -503,7 +503,7 @@ export class AsgardeoAuthClient<T> {
503503 'JS-AUTH_CORE-GSOU-NF01' ,
504504 'Sign-out endpoint not found.' ,
505505 'No sign-out endpoint was found in the OIDC provider meta data returned by the well-known endpoint ' +
506- 'or the sign-out endpoint passed to the SDK is empty.' ,
506+ 'or the sign-out endpoint passed to the SDK is empty.' ,
507507 ) ;
508508 }
509509
@@ -514,7 +514,7 @@ export class AsgardeoAuthClient<T> {
514514 'JS-AUTH_CORE-GSOU-NF03' ,
515515 'No sign-out redirect URL found.' ,
516516 'The sign-out redirect URL cannot be found or the URL passed to the SDK is empty. ' +
517- 'No sign-in redirect URL has been found either. ' ,
517+ 'No sign-in redirect URL has been found either. ' ,
518518 ) ;
519519 }
520520 const queryParams : URLSearchParams = new URLSearchParams ( ) ;
@@ -721,7 +721,7 @@ export class AsgardeoAuthClient<T> {
721721 'JS-AUTH_CORE-RAT3-NF01' ,
722722 'No revoke access token endpoint found.' ,
723723 'No revoke access token endpoint was found in the OIDC provider meta data returned by ' +
724- 'the well-known endpoint or the revoke access token endpoint passed to the SDK is empty.' ,
724+ 'the well-known endpoint or the revoke access token endpoint passed to the SDK is empty.' ,
725725 ) ;
726726 }
727727
@@ -800,7 +800,7 @@ export class AsgardeoAuthClient<T> {
800800 'JS-AUTH_CORE-RAT2-NF01' ,
801801 'No refresh token found.' ,
802802 "There was no refresh token found. Asgardeo doesn't return a " +
803- 'refresh token if the refresh token grant is not enabled.' ,
803+ 'refresh token if the refresh token grant is not enabled.' ,
804804 ) ;
805805 }
806806
@@ -809,7 +809,7 @@ export class AsgardeoAuthClient<T> {
809809 'JS-AUTH_CORE-RAT2-NF02' ,
810810 'No refresh token endpoint found.' ,
811811 'No refresh token endpoint was in the OIDC provider meta data returned by the well-known ' +
812- 'endpoint or the refresh token endpoint passed to the SDK is empty.' ,
812+ 'endpoint or the refresh token endpoint passed to the SDK is empty.' ,
813813 ) ;
814814 }
815815
@@ -930,7 +930,7 @@ export class AsgardeoAuthClient<T> {
930930 'JS-AUTH_CORE-RCG-NF01' ,
931931 'Token endpoint not found.' ,
932932 'No token endpoint was found in the OIDC provider meta data returned by the well-known endpoint ' +
933- 'or the token endpoint passed to the SDK is empty.' ,
933+ 'or the token endpoint passed to the SDK is empty.' ,
934934 ) ;
935935 }
936936
0 commit comments