-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
21,883 additions
and
16 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/*! | ||
* The buffer module from node.js, for the browser. | ||
* | ||
* @author Feross Aboukhadijeh <https://feross.org> | ||
* @license MIT | ||
*/ | ||
|
||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ | ||
|
||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { LOGIN_TYPE, UX_MODE_TYPE } from "../utils/enums"; | ||
import { Auth0ClientOptions, ILoginHandler, LoginWindowResponse, TorusGenericObject, TorusVerifierResponse } from "./interfaces"; | ||
declare abstract class AbstractLoginHandler implements ILoginHandler { | ||
readonly clientId: string; | ||
readonly verifier: string; | ||
readonly redirect_uri: string; | ||
readonly typeOfLogin: LOGIN_TYPE; | ||
readonly uxMode: UX_MODE_TYPE; | ||
readonly redirectToOpener?: boolean; | ||
readonly jwtParams?: Auth0ClientOptions; | ||
readonly customState?: TorusGenericObject; | ||
nonce: string; | ||
finalURL: URL; | ||
constructor(clientId: string, verifier: string, redirect_uri: string, typeOfLogin: LOGIN_TYPE, uxMode: UX_MODE_TYPE, redirectToOpener?: boolean, jwtParams?: Auth0ClientOptions, customState?: TorusGenericObject); | ||
get state(): string; | ||
handleLoginWindow(params: { | ||
locationReplaceOnRedirect?: boolean; | ||
popupFeatures?: string; | ||
}): Promise<LoginWindowResponse>; | ||
abstract getUserInfo(params: LoginWindowResponse): Promise<TorusVerifierResponse>; | ||
abstract setFinalUrl(): void; | ||
} | ||
export default AbstractLoginHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { LOGIN_TYPE, UX_MODE_TYPE } from "../utils/enums"; | ||
import AbstractLoginHandler from "./AbstractLoginHandler"; | ||
import { Auth0ClientOptions, LoginWindowResponse, TorusGenericObject, TorusVerifierResponse } from "./interfaces"; | ||
export default class DiscordHandler extends AbstractLoginHandler { | ||
readonly clientId: string; | ||
readonly verifier: string; | ||
readonly redirect_uri: string; | ||
readonly typeOfLogin: LOGIN_TYPE; | ||
readonly uxMode: UX_MODE_TYPE; | ||
readonly redirectToOpener?: boolean; | ||
readonly jwtParams?: Auth0ClientOptions; | ||
readonly customState?: TorusGenericObject; | ||
private readonly RESPONSE_TYPE; | ||
private readonly SCOPE; | ||
constructor(clientId: string, verifier: string, redirect_uri: string, typeOfLogin: LOGIN_TYPE, uxMode: UX_MODE_TYPE, redirectToOpener?: boolean, jwtParams?: Auth0ClientOptions, customState?: TorusGenericObject); | ||
setFinalUrl(): void; | ||
getUserInfo(params: LoginWindowResponse): Promise<TorusVerifierResponse>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { LOGIN_TYPE, UX_MODE_TYPE } from "../utils/enums"; | ||
import AbstractLoginHandler from "./AbstractLoginHandler"; | ||
import { Auth0ClientOptions, LoginWindowResponse, TorusGenericObject, TorusVerifierResponse } from "./interfaces"; | ||
export default class FacebookHandler extends AbstractLoginHandler { | ||
readonly clientId: string; | ||
readonly verifier: string; | ||
readonly redirect_uri: string; | ||
readonly typeOfLogin: LOGIN_TYPE; | ||
readonly uxMode: UX_MODE_TYPE; | ||
readonly redirectToOpener?: boolean; | ||
readonly jwtParams?: Auth0ClientOptions; | ||
readonly customState?: TorusGenericObject; | ||
private readonly RESPONSE_TYPE; | ||
private readonly SCOPE; | ||
constructor(clientId: string, verifier: string, redirect_uri: string, typeOfLogin: LOGIN_TYPE, uxMode: UX_MODE_TYPE, redirectToOpener?: boolean, jwtParams?: Auth0ClientOptions, customState?: TorusGenericObject); | ||
setFinalUrl(): void; | ||
getUserInfo(params: LoginWindowResponse): Promise<TorusVerifierResponse>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { LOGIN_TYPE, UX_MODE_TYPE } from "../utils/enums"; | ||
import AbstractLoginHandler from "./AbstractLoginHandler"; | ||
import { Auth0ClientOptions, LoginWindowResponse, TorusGenericObject, TorusVerifierResponse } from "./interfaces"; | ||
export default class GoogleHandler extends AbstractLoginHandler { | ||
readonly clientId: string; | ||
readonly verifier: string; | ||
readonly redirect_uri: string; | ||
readonly typeOfLogin: LOGIN_TYPE; | ||
readonly uxMode: UX_MODE_TYPE; | ||
readonly redirectToOpener?: boolean; | ||
readonly jwtParams?: Auth0ClientOptions; | ||
readonly customState?: TorusGenericObject; | ||
private readonly RESPONSE_TYPE; | ||
private readonly SCOPE; | ||
private readonly PROMPT; | ||
constructor(clientId: string, verifier: string, redirect_uri: string, typeOfLogin: LOGIN_TYPE, uxMode: UX_MODE_TYPE, redirectToOpener?: boolean, jwtParams?: Auth0ClientOptions, customState?: TorusGenericObject); | ||
setFinalUrl(): void; | ||
getUserInfo(params: LoginWindowResponse): Promise<TorusVerifierResponse>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { CreateHandlerParams, ILoginHandler } from "./interfaces"; | ||
declare const createHandler: ({ clientId, redirect_uri, typeOfLogin, verifier, jwtParams, redirectToOpener, uxMode, customState, registerOnly, }: CreateHandlerParams) => ILoginHandler; | ||
export default createHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { LOGIN_TYPE, UX_MODE_TYPE } from "../utils/enums"; | ||
import AbstractLoginHandler from "./AbstractLoginHandler"; | ||
import { Auth0ClientOptions, LoginWindowResponse, TorusGenericObject, TorusVerifierResponse } from "./interfaces"; | ||
export default class JwtHandler extends AbstractLoginHandler { | ||
readonly clientId: string; | ||
readonly verifier: string; | ||
readonly redirect_uri: string; | ||
readonly typeOfLogin: LOGIN_TYPE; | ||
readonly uxMode: UX_MODE_TYPE; | ||
readonly redirectToOpener?: boolean; | ||
readonly jwtParams?: Auth0ClientOptions; | ||
readonly customState?: TorusGenericObject; | ||
private readonly SCOPE; | ||
private readonly RESPONSE_TYPE; | ||
private readonly PROMPT; | ||
constructor(clientId: string, verifier: string, redirect_uri: string, typeOfLogin: LOGIN_TYPE, uxMode: UX_MODE_TYPE, redirectToOpener?: boolean, jwtParams?: Auth0ClientOptions, customState?: TorusGenericObject); | ||
setFinalUrl(): void; | ||
getUserInfo(params: LoginWindowResponse): Promise<TorusVerifierResponse>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { LOGIN_TYPE, UX_MODE_TYPE } from "../utils/enums"; | ||
import AbstractLoginHandler from "./AbstractLoginHandler"; | ||
import { Auth0ClientOptions, LoginWindowResponse, TorusGenericObject, TorusVerifierResponse } from "./interfaces"; | ||
export default class MockLoginHandler extends AbstractLoginHandler { | ||
readonly clientId: string; | ||
readonly verifier: string; | ||
readonly redirect_uri: string; | ||
readonly typeOfLogin: LOGIN_TYPE; | ||
readonly uxMode: UX_MODE_TYPE; | ||
readonly redirectToOpener?: boolean; | ||
readonly jwtParams?: Auth0ClientOptions; | ||
readonly customState?: TorusGenericObject; | ||
constructor(clientId: string, verifier: string, redirect_uri: string, typeOfLogin: LOGIN_TYPE, uxMode: UX_MODE_TYPE, redirectToOpener?: boolean, jwtParams?: Auth0ClientOptions, customState?: TorusGenericObject); | ||
setFinalUrl(): void; | ||
getUserInfo(params: LoginWindowResponse): Promise<TorusVerifierResponse>; | ||
handleLoginWindow(params: { | ||
locationReplaceOnRedirect?: boolean; | ||
popupFeatures?: string; | ||
}): Promise<LoginWindowResponse>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { LOGIN_TYPE, UX_MODE_TYPE } from "../utils/enums"; | ||
import AbstractLoginHandler from "./AbstractLoginHandler"; | ||
import { Auth0ClientOptions, LoginWindowResponse, TorusGenericObject, TorusVerifierResponse } from "./interfaces"; | ||
export default class JwtHandler extends AbstractLoginHandler { | ||
readonly clientId: string; | ||
readonly verifier: string; | ||
readonly redirect_uri: string; | ||
readonly typeOfLogin: LOGIN_TYPE; | ||
readonly uxMode: UX_MODE_TYPE; | ||
readonly redirectToOpener?: boolean; | ||
readonly jwtParams?: Auth0ClientOptions; | ||
readonly customState?: TorusGenericObject; | ||
private readonly SCOPE; | ||
private readonly RESPONSE_TYPE; | ||
private readonly PROMPT; | ||
constructor(clientId: string, verifier: string, redirect_uri: string, typeOfLogin: LOGIN_TYPE, uxMode: UX_MODE_TYPE, redirectToOpener?: boolean, jwtParams?: Auth0ClientOptions, customState?: TorusGenericObject); | ||
setFinalUrl(): void; | ||
getUserInfo(params: LoginWindowResponse): Promise<TorusVerifierResponse>; | ||
handleLoginWindow(): Promise<LoginWindowResponse>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { LOGIN_TYPE, UX_MODE_TYPE } from "../utils/enums"; | ||
import AbstractLoginHandler from "./AbstractLoginHandler"; | ||
import { Auth0ClientOptions, LoginWindowResponse, TorusGenericObject, TorusVerifierResponse } from "./interfaces"; | ||
export default class RedditHandler extends AbstractLoginHandler { | ||
readonly clientId: string; | ||
readonly verifier: string; | ||
readonly redirect_uri: string; | ||
readonly typeOfLogin: LOGIN_TYPE; | ||
readonly uxMode: UX_MODE_TYPE; | ||
readonly redirectToOpener?: boolean; | ||
readonly jwtParams?: Auth0ClientOptions; | ||
readonly customState?: TorusGenericObject; | ||
private readonly RESPONSE_TYPE; | ||
private readonly SCOPE; | ||
constructor(clientId: string, verifier: string, redirect_uri: string, typeOfLogin: LOGIN_TYPE, uxMode: UX_MODE_TYPE, redirectToOpener?: boolean, jwtParams?: Auth0ClientOptions, customState?: TorusGenericObject); | ||
setFinalUrl(): void; | ||
getUserInfo(params: LoginWindowResponse): Promise<TorusVerifierResponse>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { LOGIN_TYPE, UX_MODE_TYPE } from "../utils/enums"; | ||
import AbstractLoginHandler from "./AbstractLoginHandler"; | ||
import { Auth0ClientOptions, LoginWindowResponse, TorusGenericObject, TorusVerifierResponse } from "./interfaces"; | ||
export default class TwitchHandler extends AbstractLoginHandler { | ||
readonly clientId: string; | ||
readonly verifier: string; | ||
readonly redirect_uri: string; | ||
readonly typeOfLogin: LOGIN_TYPE; | ||
readonly uxMode: UX_MODE_TYPE; | ||
readonly redirectToOpener?: boolean; | ||
readonly jwtParams?: Auth0ClientOptions; | ||
readonly customState?: TorusGenericObject; | ||
private readonly RESPONSE_TYPE; | ||
private readonly SCOPE; | ||
constructor(clientId: string, verifier: string, redirect_uri: string, typeOfLogin: LOGIN_TYPE, uxMode: UX_MODE_TYPE, redirectToOpener?: boolean, jwtParams?: Auth0ClientOptions, customState?: TorusGenericObject); | ||
setFinalUrl(): void; | ||
getUserInfo(params: LoginWindowResponse): Promise<TorusVerifierResponse>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { LOGIN_TYPE, UX_MODE_TYPE } from "../utils/enums"; | ||
import AbstractLoginHandler from "./AbstractLoginHandler"; | ||
import { Auth0ClientOptions, LoginWindowResponse, TorusGenericObject, TorusVerifierResponse } from "./interfaces"; | ||
export default class WebAuthnHandler extends AbstractLoginHandler { | ||
readonly clientId: string; | ||
readonly verifier: string; | ||
readonly redirect_uri: string; | ||
readonly typeOfLogin: LOGIN_TYPE; | ||
readonly uxMode: UX_MODE_TYPE; | ||
readonly redirectToOpener?: boolean; | ||
readonly jwtParams?: Auth0ClientOptions; | ||
readonly customState?: TorusGenericObject; | ||
readonly registerOnly?: boolean; | ||
constructor(clientId: string, verifier: string, redirect_uri: string, typeOfLogin: LOGIN_TYPE, uxMode: UX_MODE_TYPE, redirectToOpener?: boolean, jwtParams?: Auth0ClientOptions, customState?: TorusGenericObject, registerOnly?: boolean); | ||
setFinalUrl(): void; | ||
getUserInfo(parameters: LoginWindowResponse): Promise<TorusVerifierResponse>; | ||
} |
Oops, something went wrong.