Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
runIframe,
sha256,
bufferToBase64UrlEncoded,
oauthToken,
openPopup
} from './utils';
import Cache from './cache';
import TransactionManager from './transaction-manager';
import { verify as verifyIdToken } from './jwt';
import { AuthenticationError } from './errors';
import * as ClientStorage from './storage';
import { DEFAULT_POPUP_CONFIG_OPTIONS } from './constants';
import version from './version';
const lock = new Lock();
const GET_TOKEN_SILENTLY_LOCK_KEY = 'auth0.lock.getTokenSilently';
/**
* Auth0 SDK for Single Page Applications using [Authorization Code Grant Flow with PKCE](https://auth0.com/docs/api-auth/tutorials/authorization-code-grant-pkce).
*/
export default class Auth0Client {
private cache: Cache;
private transactionManager: TransactionManager;
private domainUrl: string;
private tokenIssuer: string;
private readonly DEFAULT_SCOPE = 'openid profile email';
constructor(private options: Auth0ClientOptions) {
this.cache = new Cache();
this.transactionManager = new TransactionManager();
this.domainUrl = `https://${this.options.domain}`;