zudoku 0.3.0-dev.69 → 0.3.0-dev.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/config.d.ts +14 -12
- package/dist/lib/authentication/Callback.d.ts +1 -1
- package/dist/lib/authentication/Callback.js +2 -2
- package/dist/lib/authentication/Callback.js.map +1 -1
- package/dist/lib/authentication/providers/auth0.js +2 -3
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +5 -5
- package/dist/lib/authentication/providers/openid.js +13 -1
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/lib/zudoku.auth-auth0.js +9 -10
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-openid.js +55 -55
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/authentication/Callback.tsx +3 -3
- package/src/lib/authentication/providers/auth0.tsx +2 -3
- package/src/lib/authentication/providers/openid.tsx +17 -6
package/dist/config/config.d.ts
CHANGED
|
@@ -11,29 +11,31 @@ export interface DocsConfig {
|
|
|
11
11
|
files?: string;
|
|
12
12
|
defaultOptions?: MarkdownPluginOptions["defaultOptions"];
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export type ClerkAuthenticationConfig = {
|
|
15
15
|
type: "clerk";
|
|
16
16
|
clerkPubKey: `pk_test_${string}` | `pk_live_${string}`;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
redirectToAfterSignOut?: string;
|
|
20
|
-
}
|
|
21
|
-
export interface OpenIDAuthenticationConfig {
|
|
17
|
+
} & RedirectOptions;
|
|
18
|
+
export type OpenIDAuthenticationConfig = {
|
|
22
19
|
type: "openid";
|
|
23
20
|
clientId: string;
|
|
24
|
-
redirectToAfterSignUp?: string;
|
|
25
|
-
redirectToAfterSignIn?: string;
|
|
26
|
-
redirectToAfterSignOut?: string;
|
|
27
21
|
issuer: string;
|
|
28
22
|
scopes?: string[];
|
|
29
23
|
audience?: string;
|
|
30
24
|
jwksEndpoint?: URL | URLString;
|
|
31
25
|
authorizationEndpoint?: string;
|
|
32
26
|
tokenEndpoint?: string;
|
|
33
|
-
}
|
|
34
|
-
export
|
|
27
|
+
} & RedirectOptions;
|
|
28
|
+
export type Auth0AuthenticationConfig = {
|
|
35
29
|
type: "auth0";
|
|
36
30
|
clientId: string;
|
|
37
31
|
domain: string;
|
|
38
32
|
audience?: string;
|
|
39
|
-
|
|
33
|
+
redirectToAfterSignUp?: string;
|
|
34
|
+
redirectToAfterSignIn?: string;
|
|
35
|
+
redirectToAfterSignOut?: string;
|
|
36
|
+
} & RedirectOptions;
|
|
37
|
+
type RedirectOptions = {
|
|
38
|
+
redirectToAfterSignUp?: string;
|
|
39
|
+
redirectToAfterSignIn?: string;
|
|
40
|
+
redirectToAfterSignOut?: string;
|
|
41
|
+
};
|
|
@@ -15,9 +15,9 @@ export function Callback({ handleCallback, }) {
|
|
|
15
15
|
}
|
|
16
16
|
didInitialize.current = true;
|
|
17
17
|
handleCallback()
|
|
18
|
-
.then(() => {
|
|
18
|
+
.then((redirect) => {
|
|
19
19
|
// TODO: Handle return url, state, etc
|
|
20
|
-
navigate(
|
|
20
|
+
navigate(redirect);
|
|
21
21
|
})
|
|
22
22
|
.catch((err) => {
|
|
23
23
|
setError(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Callback.js","sourceRoot":"","sources":["../../../src/lib/authentication/Callback.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,UAAU,QAAQ,CAAC,EACvB,cAAc,GAGf;IACC,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACpC,MAAM,C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;IACP,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAI,KAAK,EAAE,CAAC;QACV,IAAI,KAAK,YAAY,uBAAuB,EAAE,CAAC;YAC7C,OAAO,CACL,0BACE,iCAAc,EACd,0BACG,KAAK,CAAC,KAAK,CAAC,KAAK,EAEjB,KAAK,CAAC,KAAK,CAAC,iBAAiB,EAE7B,KAAK,CAAC,KAAK,CAAC,SAAS,IAClB,IACF,CACP,CAAC;QACJ,CAAC;QACD,OAAO,CACL,0BACE,iCAAc,EACd,0BACG,KAAK,CAAC,OAAO,EAEb,KAAK,CAAC,KAAK,IACR,IACF,CACP,CAAC;IACJ,CAAC;IAED,OAAO,uCAAqB,CAAC;AAC/B,CAAC"}
|
|
@@ -31,11 +31,10 @@ class Auth0AuthenticationProvider extends OpenIDAuthenticationProvider {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
const auth0Auth = ({ domain,
|
|
34
|
+
const auth0Auth = ({ domain, ...options }) => new Auth0AuthenticationProvider({
|
|
35
|
+
...options,
|
|
35
36
|
type: "openid",
|
|
36
37
|
issuer: `https://${domain}`,
|
|
37
|
-
clientId: clientId,
|
|
38
|
-
audience: audience,
|
|
39
38
|
});
|
|
40
39
|
export default auth0Auth;
|
|
41
40
|
//# sourceMappingURL=auth0.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth0.js","sourceRoot":"","sources":["../../../../src/lib/authentication/providers/auth0.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAE3D,MAAM,2BAA4B,SAAQ,4BAA4B;IAC3D,KAAK,CAAC,OAAO;QACpB,YAAY,CAAC,QAAQ,CAAC;YACpB,eAAe,EAAE,KAAK;YACtB,SAAS,EAAE,KAAK;YAChB,OAAO,EAAE,SAAS;SACnB,CAAC,CAAC;QACH,MAAM,E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M,WAAW,GAAG,IAAI,GAAG,CACzB,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,qBAAqB,CACpD,CAAC;QACF,WAAW,CAAC,QAAQ,GAAG,IAAI,CAAC,qBAAqB,CAAC;QAElD,+EAA+E;QAC/E,uEAAuE;QACvE,+DAA+D;QAC/D,wDAAwD;QAExD,IAAI,SAAc,CAAC;QACnB,uEAAuE;QACvE,sEAAsE;QACtE,IAAI,EAAE,CAAC,oBAAoB,EAAE,CAAC;YAC5B,SAAS,GAAG,IAAI,GAAG,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC;YAC7C,kCAAkC;YAClC,gCAAgC;YAChC,kBAAkB;YAClB,2DAA2D;YAC3D,IAAI;YACJ,SAAS,CAAC,YAAY,CAAC,GAAG,CACxB,0BAA0B,EAC1B,WAAW,CAAC,QAAQ,EAAE,CACvB,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,aAAa,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;CACF;AAED,MAAM,SAAS,GAEX,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,EAAE,EAAE,CAC7B,IAAI,2BAA2B,CAAC;IAC9B,GAAG,OAAO;IACV,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE,WAAW,MAAM,EAAE;CAC5B,CAAC,CAAC;AAEL,eAAe,SAAS,CAAC"}
|
|
@@ -11,7 +11,7 @@ interface TokenState {
|
|
|
11
11
|
declare class OpenIdAuthPlugin extends AuthenticationPlugin {
|
|
12
12
|
private callbackUrlPath;
|
|
13
13
|
private handleCallback;
|
|
14
|
-
constructor(callbackUrlPath: string, handleCallback: () => Promise<
|
|
14
|
+
constructor(callbackUrlPath: string, handleCallback: () => Promise<string>);
|
|
15
15
|
getRoutes(): {
|
|
16
16
|
path: string;
|
|
17
17
|
element: import("react/jsx-runtime").JSX.Element;
|
|
@@ -26,9 +26,9 @@ export declare class OpenIDAuthenticationProvider implements AuthenticationProvi
|
|
|
26
26
|
protected tokens: TokenState | undefined;
|
|
27
27
|
protected callbackUrlPath: string;
|
|
28
28
|
protected logoutRedirectUrlPath: string;
|
|
29
|
-
private redirectToAfterSignUp
|
|
30
|
-
private redirectToAfterSignIn
|
|
31
|
-
private redirectToAfterSignOut
|
|
29
|
+
private redirectToAfterSignUp;
|
|
30
|
+
private redirectToAfterSignIn;
|
|
31
|
+
private redirectToAfterSignOut;
|
|
32
32
|
constructor({ issuer, authorizationEndpoint, tokenEndpoint, clientId, redirectToAfterSignUp, redirectToAfterSignIn, redirectToAfterSignOut, }: OpenIDAuthenticationConfig);
|
|
33
33
|
protected getAuthServer(): Promise<oauth.AuthorizationServer>;
|
|
34
34
|
/**
|
|
@@ -41,7 +41,7 @@ export declare class OpenIDAuthenticationProvider implements AuthenticationProvi
|
|
|
41
41
|
private authorize;
|
|
42
42
|
getAccessToken(): Promise<string>;
|
|
43
43
|
signOut(): Promise<void>;
|
|
44
|
-
handleCallback: () => Promise<
|
|
44
|
+
handleCallback: () => Promise<string>;
|
|
45
45
|
getAuthenticationPlugin(): OpenIdAuthPlugin;
|
|
46
46
|
}
|
|
47
47
|
declare const openIDAuth: AuthenticationProviderInitializer<OpenIDAuthenticationConfig>;
|
|
@@ -94,6 +94,12 @@ export class OpenIDAuthenticationProvider {
|
|
|
94
94
|
async authorize(signUp = false) {
|
|
95
95
|
const code_challenge_method = "S256";
|
|
96
96
|
const authorizationServer = await this.getAuthServer();
|
|
97
|
+
if (signUp) {
|
|
98
|
+
localStorage.setItem("sign-up", "true");
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
localStorage.removeItem("sign-up");
|
|
102
|
+
}
|
|
97
103
|
if (!authorizationServer.authorization_endpoint) {
|
|
98
104
|
throw new AuthorizationError("No authorization endpoint");
|
|
99
105
|
}
|
|
@@ -192,7 +198,7 @@ export class OpenIDAuthenticationProvider {
|
|
|
192
198
|
throw new OAuthAuthorizationError("Error validating OAuth response", params);
|
|
193
199
|
}
|
|
194
200
|
const redirectUrl = new URL(url);
|
|
195
|
-
redirectUrl.pathname = this.callbackUrlPath;
|
|
201
|
+
redirectUrl.pathname = this.redirectToAfterSignIn ?? this.callbackUrlPath;
|
|
196
202
|
redirectUrl.search = "";
|
|
197
203
|
const response = await oauth.authorizationCodeGrantRequest(authServer, this.client, params, redirectUrl.toString(), codeVerifier);
|
|
198
204
|
// TODO: do we need to do these
|
|
@@ -220,6 +226,12 @@ export class OpenIDAuthenticationProvider {
|
|
|
220
226
|
isPending: false,
|
|
221
227
|
profile,
|
|
222
228
|
});
|
|
229
|
+
if (localStorage.getItem("sign-up")) {
|
|
230
|
+
return this.redirectToAfterSignUp;
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
return this.redirectToAfterSignIn;
|
|
234
|
+
}
|
|
223
235
|
// // Remove the query strings so react query doesn't keep retrying
|
|
224
236
|
// // to make the token request
|
|
225
237
|
// history.replaceState({}, "", window.location.pathname);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openid.js","sourceRoot":"","sources":["../../../../src/lib/authentication/providers/openid.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAMtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAe,MAAM,aAAa,CAAC;AAExD,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAS1C,MAAM,gBAAiB,SAAQ,oBAAoB;IAEvC;IACA;IAFV,YACU,eAAuB,EACvB,
|
|
1
|
+
{"version":3,"file":"openid.js","sourceRoot":"","sources":["../../../../src/lib/authentication/providers/openid.ts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B,SAAS,EAAE,KAAK;YAChB,OAAO;SACR,CAAC,CAAC;QAEH,IAAI,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;YACpC,OAAO,IAAI,CAAC,qBAAqB,CAAC;QACpC,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAC,qBAAqB,CAAC;QACpC,CAAC;QAED,mEAAmE;QACnE,+BAA+B;QAC/B,0DAA0D;QAE1D,kDAAkD;QAClD,eAAe;IACjB,CAAC,CAAC;IAEF,uBAAuB;QACrB,OAAO,IAAI,gBAAgB,CAAC,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE,CACrD,IAAI,CAAC,cAAc,EAAE,CACtB,CAAC;IACJ,CAAC;CACF;AAED,MAAM,UAAU,GAEZ,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,4BAA4B,CAAC,OAAO,CAAC,CAAC;AAE3D,eAAe,UAAU,CAAC"}
|
package/lib/zudoku.auth-auth0.js
CHANGED
|
@@ -7,22 +7,21 @@ class r extends n {
|
|
|
7
7
|
isPending: !1,
|
|
8
8
|
profile: void 0
|
|
9
9
|
});
|
|
10
|
-
const t = await this.getAuthServer(),
|
|
10
|
+
const t = await this.getAuthServer(), s = new URL(
|
|
11
11
|
window.location.origin + this.logoutRedirectUrlPath
|
|
12
12
|
);
|
|
13
|
-
|
|
14
|
-
let
|
|
15
|
-
t.end_session_endpoint ? (
|
|
13
|
+
s.pathname = this.logoutRedirectUrlPath;
|
|
14
|
+
let e;
|
|
15
|
+
t.end_session_endpoint ? (e = new URL(t.end_session_endpoint), e.searchParams.set(
|
|
16
16
|
"post_logout_redirect_uri",
|
|
17
|
-
|
|
18
|
-
)) :
|
|
17
|
+
s.toString()
|
|
18
|
+
)) : e = new URL(`${this.issuer}oidc/logout`);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
const d = ({ domain:
|
|
21
|
+
const d = ({ domain: i, ...t }) => new r({
|
|
22
|
+
...t,
|
|
22
23
|
type: "openid",
|
|
23
|
-
issuer: `https://${
|
|
24
|
-
clientId: t,
|
|
25
|
-
audience: e
|
|
24
|
+
issuer: `https://${i}`
|
|
26
25
|
});
|
|
27
26
|
export {
|
|
28
27
|
d as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.auth-auth0.js","sources":["../src/lib/authentication/providers/auth0.tsx"],"sourcesContent":["import { Auth0AuthenticationConfig } from \"../../../config/config.js\";\nimport { AuthenticationProviderInitializer } from \"../authentication.js\";\nimport { useAuthState } from \"../state.js\";\nimport { OpenIDAuthenticationProvider } from \"./openid.js\";\n\nclass Auth0AuthenticationProvider extends OpenIDAuthenticationProvider {\n override async signOut(): Promise<void> {\n useAuthState.setState({\n isAuthenticated: false,\n isPending: false,\n profile: undefined,\n });\n const as = await this.getAuthServer();\n\n const redirectUrl = new URL(\n window.location.origin + this.logoutRedirectUrlPath,\n );\n redirectUrl.pathname = this.logoutRedirectUrlPath;\n\n // SEE: https://auth0.com/docs/authenticate/login/logout/log-users-out-of-auth0\n // For Auth0 tenants created on or after 14 November 2023, RP-Initiated\n // Logout End Session Endpoint Discovery is enabled by default.\n // Otherwise we fallback to the old non-compliant logout\n\n let logoutUrl: URL;\n // The endSessionEndpoint is set, the IdP supports some form of logout,\n // so we use the IdP logout. Otherwise, just redirect the user to home\n if (as.end_session_endpoint) {\n logoutUrl = new URL(as.end_session_endpoint);\n // TODO: get id_token and set hint\n // const { id_token } = session;\n // if (id_token) {\n // logoutUrl.searchParams.set(\"id_token_hint\", id_token);\n // }\n logoutUrl.searchParams.set(\n \"post_logout_redirect_uri\",\n redirectUrl.toString(),\n );\n } else {\n logoutUrl = new URL(`${this.issuer}oidc/logout`);\n }\n }\n}\n\nconst auth0Auth: AuthenticationProviderInitializer<\n Auth0AuthenticationConfig\n> = ({ domain,
|
|
1
|
+
{"version":3,"file":"zudoku.auth-auth0.js","sources":["../src/lib/authentication/providers/auth0.tsx"],"sourcesContent":["import { Auth0AuthenticationConfig } from \"../../../config/config.js\";\nimport { AuthenticationProviderInitializer } from \"../authentication.js\";\nimport { useAuthState } from \"../state.js\";\nimport { OpenIDAuthenticationProvider } from \"./openid.js\";\n\nclass Auth0AuthenticationProvider extends OpenIDAuthenticationProvider {\n override async signOut(): Promise<void> {\n useAuthState.setState({\n isAuthenticated: false,\n isPending: false,\n profile: undefined,\n });\n const as = await this.getAuthServer();\n\n const redirectUrl = new URL(\n window.location.origin + this.logoutRedirectUrlPath,\n );\n redirectUrl.pathname = this.logoutRedirectUrlPath;\n\n // SEE: https://auth0.com/docs/authenticate/login/logout/log-users-out-of-auth0\n // For Auth0 tenants created on or after 14 November 2023, RP-Initiated\n // Logout End Session Endpoint Discovery is enabled by default.\n // Otherwise we fallback to the old non-compliant logout\n\n let logoutUrl: URL;\n // The endSessionEndpoint is set, the IdP supports some form of logout,\n // so we use the IdP logout. Otherwise, just redirect the user to home\n if (as.end_session_endpoint) {\n logoutUrl = new URL(as.end_session_endpoint);\n // TODO: get id_token and set hint\n // const { id_token } = session;\n // if (id_token) {\n // logoutUrl.searchParams.set(\"id_token_hint\", id_token);\n // }\n logoutUrl.searchParams.set(\n \"post_logout_redirect_uri\",\n redirectUrl.toString(),\n );\n } else {\n logoutUrl = new URL(`${this.issuer}oidc/logout`);\n }\n }\n}\n\nconst auth0Auth: AuthenticationProviderInitializer<\n Auth0AuthenticationConfig\n> = ({ domain, ...options }) =>\n new Auth0AuthenticationProvider({\n ...options,\n type: \"openid\",\n issuer: `https://${domain}`,\n });\n\nexport default auth0Auth;\n"],"names":["Auth0AuthenticationProvider","OpenIDAuthenticationProvider","useAuthState","as","redirectUrl","logoutUrl","auth0Auth","domain","options"],"mappings":";;AAKA,MAAMA,UAAoCC,EAA6B;AAAA,EACrE,MAAe,UAAyB;AACtC,IAAAC,EAAa,SAAS;AAAA,MACpB,iBAAiB;AAAA,MACjB,WAAW;AAAA,MACX,SAAS;AAAA,IAAA,CACV;AACK,UAAAC,IAAK,MAAM,KAAK,iBAEhBC,IAAc,IAAI;AAAA,MACtB,OAAO,SAAS,SAAS,KAAK;AAAA,IAAA;AAEhC,IAAAA,EAAY,WAAW,KAAK;AAOxB,QAAAC;AAGJ,IAAIF,EAAG,wBACOE,IAAA,IAAI,IAAIF,EAAG,oBAAoB,GAM3CE,EAAU,aAAa;AAAA,MACrB;AAAA,MACAD,EAAY,SAAS;AAAA,IAAA,KAGvBC,IAAY,IAAI,IAAI,GAAG,KAAK,MAAM,aAAa;AAAA,EAEnD;AACF;AAEM,MAAAC,IAEF,CAAC,EAAE,QAAAC,GAAQ,GAAGC,EAAQ,MACxB,IAAIR,EAA4B;AAAA,EAC9B,GAAGQ;AAAA,EACH,MAAM;AAAA,EACN,QAAQ,WAAWD,CAAM;AAC3B,CAAC;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var Re = Object.defineProperty;
|
|
2
2
|
var Pe = (t, e, n) => e in t ? Re(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
3
|
var y = (t, e, n) => Pe(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
-
import { b as xe, j as
|
|
4
|
+
import { b as xe, j as A } from "./jsx-runtime-BIr0WBt_.js";
|
|
5
5
|
import { c as Ue, a as Le } from "./_commonjsHelpers-BVfed4GL.js";
|
|
6
6
|
import { A as Ce } from "./AuthenticationPlugin-RvXALgvS.js";
|
|
7
|
-
import { useRef as je, useState as
|
|
7
|
+
import { useRef as je, useState as Ie, useEffect as ze } from "react";
|
|
8
8
|
import { u as re } from "./state-DKdaQzvh.js";
|
|
9
9
|
var he = { exports: {} };
|
|
10
10
|
(function(t) {
|
|
@@ -54,9 +54,9 @@ var he = { exports: {} };
|
|
|
54
54
|
return m(l) || _.apply(this, arguments);
|
|
55
55
|
}
|
|
56
56
|
function U(l, f) {
|
|
57
|
-
var c = this,
|
|
57
|
+
var c = this, z, $, P, v = "loglevel";
|
|
58
58
|
typeof l == "string" ? v += ":" + l : typeof l == "symbol" && (v = void 0);
|
|
59
|
-
function
|
|
59
|
+
function Te(d) {
|
|
60
60
|
var p = (s[d] || "silent").toUpperCase();
|
|
61
61
|
if (!(typeof window === n || !v)) {
|
|
62
62
|
try {
|
|
@@ -79,16 +79,16 @@ var he = { exports: {} };
|
|
|
79
79
|
}
|
|
80
80
|
if (typeof d === n)
|
|
81
81
|
try {
|
|
82
|
-
var p = window.document.cookie,
|
|
82
|
+
var p = window.document.cookie, J = encodeURIComponent(v), ne = p.indexOf(J + "=");
|
|
83
83
|
ne !== -1 && (d = /^([^;]+)/.exec(
|
|
84
|
-
p.slice(ne +
|
|
84
|
+
p.slice(ne + J.length + 1)
|
|
85
85
|
)[1]);
|
|
86
86
|
} catch {
|
|
87
87
|
}
|
|
88
88
|
return c.levels[d] === void 0 && (d = void 0), d;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function Ae() {
|
|
92
92
|
if (!(typeof window === n || !v)) {
|
|
93
93
|
try {
|
|
94
94
|
window.localStorage.removeItem(v);
|
|
@@ -114,22 +114,22 @@ var he = { exports: {} };
|
|
|
114
114
|
ERROR: 4,
|
|
115
115
|
SILENT: 5
|
|
116
116
|
}, c.methodFactory = f || h, c.getLevel = function() {
|
|
117
|
-
return P ?? $ ??
|
|
117
|
+
return P ?? $ ?? z;
|
|
118
118
|
}, c.setLevel = function(d, p) {
|
|
119
|
-
return P = L(d), p !== !1 &&
|
|
119
|
+
return P = L(d), p !== !1 && Te(P), b.call(c);
|
|
120
120
|
}, c.setDefaultLevel = function(d) {
|
|
121
121
|
$ = L(d), ee() || c.setLevel(d, !1);
|
|
122
122
|
}, c.resetLevel = function() {
|
|
123
|
-
P = null,
|
|
123
|
+
P = null, Ae(), b.call(c);
|
|
124
124
|
}, c.enableAll = function(d) {
|
|
125
125
|
c.setLevel(c.levels.TRACE, d);
|
|
126
126
|
}, c.disableAll = function(d) {
|
|
127
127
|
c.setLevel(c.levels.SILENT, d);
|
|
128
128
|
}, c.rebuild = function() {
|
|
129
|
-
if (i !== c && (
|
|
129
|
+
if (i !== c && (z = L(i.getLevel())), b.call(c), i === c)
|
|
130
130
|
for (var d in o)
|
|
131
131
|
o[d].rebuild();
|
|
132
|
-
},
|
|
132
|
+
}, z = L(
|
|
133
133
|
i ? i.getLevel() : "WARN"
|
|
134
134
|
);
|
|
135
135
|
var te = ee();
|
|
@@ -152,11 +152,11 @@ var he = { exports: {} };
|
|
|
152
152
|
}, i.default = i, i;
|
|
153
153
|
});
|
|
154
154
|
})(he);
|
|
155
|
-
var
|
|
156
|
-
const oe = /* @__PURE__ */ Le(
|
|
155
|
+
var Je = he.exports;
|
|
156
|
+
const oe = /* @__PURE__ */ Le(Je);
|
|
157
157
|
let M;
|
|
158
|
-
var
|
|
159
|
-
(typeof navigator > "u" || !((de = (
|
|
158
|
+
var O, de;
|
|
159
|
+
(typeof navigator > "u" || !((de = (O = navigator.userAgent) == null ? void 0 : O.startsWith) != null && de.call(O, "Mozilla/5.0 "))) && (M = "oauth4webapi/v2.11.1");
|
|
160
160
|
function q(t, e) {
|
|
161
161
|
if (t == null)
|
|
162
162
|
return !1;
|
|
@@ -166,8 +166,8 @@ function q(t, e) {
|
|
|
166
166
|
return !1;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
const K = Symbol(),
|
|
170
|
-
function
|
|
169
|
+
const K = Symbol(), Oe = Symbol(), V = Symbol(), Ne = new TextEncoder(), Ke = new TextDecoder();
|
|
170
|
+
function E(t) {
|
|
171
171
|
return typeof t == "string" ? Ne.encode(t) : Ke.decode(t);
|
|
172
172
|
}
|
|
173
173
|
const ie = 32768;
|
|
@@ -188,7 +188,7 @@ function De(t) {
|
|
|
188
188
|
throw new a("The input to be decoded is not correctly encoded.", { cause: e });
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function T(t) {
|
|
192
192
|
return typeof t == "string" ? De(t) : We(t);
|
|
193
193
|
}
|
|
194
194
|
class He {
|
|
@@ -313,7 +313,7 @@ async function Be(t, e) {
|
|
|
313
313
|
return n;
|
|
314
314
|
}
|
|
315
315
|
function D() {
|
|
316
|
-
return
|
|
316
|
+
return T(crypto.getRandomValues(new Uint8Array(32)));
|
|
317
317
|
}
|
|
318
318
|
function Ge() {
|
|
319
319
|
return D();
|
|
@@ -324,7 +324,7 @@ function qe() {
|
|
|
324
324
|
async function Ve(t) {
|
|
325
325
|
if (!w(t))
|
|
326
326
|
throw new TypeError('"codeVerifier" must be a non-empty string');
|
|
327
|
-
return
|
|
327
|
+
return T(await crypto.subtle.digest("SHA-256", E(t)));
|
|
328
328
|
}
|
|
329
329
|
function Ye(t) {
|
|
330
330
|
if (t instanceof CryptoKey)
|
|
@@ -398,7 +398,7 @@ function H(t) {
|
|
|
398
398
|
return typeof e == "number" && Number.isFinite(e) ? e : 0;
|
|
399
399
|
}
|
|
400
400
|
function tt(t) {
|
|
401
|
-
const e = t == null ? void 0 : t[
|
|
401
|
+
const e = t == null ? void 0 : t[Oe];
|
|
402
402
|
return typeof e == "number" && Number.isFinite(e) && Math.sign(e) !== -1 ? e : 30;
|
|
403
403
|
}
|
|
404
404
|
function Q() {
|
|
@@ -429,7 +429,7 @@ function j(t) {
|
|
|
429
429
|
throw new TypeError('"as.issuer" property must be a non-empty string');
|
|
430
430
|
return !0;
|
|
431
431
|
}
|
|
432
|
-
function
|
|
432
|
+
function I(t) {
|
|
433
433
|
if (typeof t != "object" || t === null)
|
|
434
434
|
throw new TypeError('"client" must be an object');
|
|
435
435
|
if (!w(t.client_id))
|
|
@@ -482,7 +482,7 @@ async function ot(t, e, n, r, s) {
|
|
|
482
482
|
async function me(t, e, n) {
|
|
483
483
|
if (!n.usages.includes("sign"))
|
|
484
484
|
throw new TypeError('CryptoKey instances used for signing assertions must include "sign" in their "usages"');
|
|
485
|
-
const r = `${E(
|
|
485
|
+
const r = `${T(E(JSON.stringify(t)))}.${T(E(JSON.stringify(e)))}`, s = T(await crypto.subtle.sign(Se(n), n, E(r)));
|
|
486
486
|
return `${r}.${s}`;
|
|
487
487
|
}
|
|
488
488
|
async function it(t, e, n, r, s, o) {
|
|
@@ -505,7 +505,7 @@ async function it(t, e, n, r, s, o) {
|
|
|
505
505
|
htm: r,
|
|
506
506
|
nonce: g,
|
|
507
507
|
htu: `${n.origin}${n.pathname}`,
|
|
508
|
-
ath: o ?
|
|
508
|
+
ath: o ? T(await crypto.subtle.digest("SHA-256", E(o))) : void 0
|
|
509
509
|
}, i);
|
|
510
510
|
t.set("dpop", b);
|
|
511
511
|
}
|
|
@@ -543,7 +543,7 @@ async function ut(t, e, n, r, s, o) {
|
|
|
543
543
|
}).then(Y);
|
|
544
544
|
}
|
|
545
545
|
async function lt(t, e, n, r) {
|
|
546
|
-
j(t),
|
|
546
|
+
j(t), I(e);
|
|
547
547
|
const s = ye(t, "userinfo_endpoint"), o = W(r == null ? void 0 : r.headers);
|
|
548
548
|
return e.userinfo_signed_response_alg ? o.set("accept", "application/jwt") : (o.set("accept", "application/json"), o.append("accept", "application/jwt")), ut(n, "GET", s, o, null, {
|
|
549
549
|
...r,
|
|
@@ -566,14 +566,14 @@ async function _e(t, e, n, r, s) {
|
|
|
566
566
|
return i.set("accept", "application/json"), dt(t, e, "POST", o, r, i, s);
|
|
567
567
|
}
|
|
568
568
|
async function ht(t, e, n, r) {
|
|
569
|
-
if (j(t),
|
|
569
|
+
if (j(t), I(e), !w(n))
|
|
570
570
|
throw new TypeError('"refreshToken" must be a non-empty string');
|
|
571
571
|
const s = new URLSearchParams(r == null ? void 0 : r.additionalParameters);
|
|
572
572
|
return s.set("refresh_token", n), _e(t, e, "refresh_token", s, r);
|
|
573
573
|
}
|
|
574
574
|
const ft = /* @__PURE__ */ new WeakMap();
|
|
575
575
|
async function be(t, e, n, r = !1, s = !1) {
|
|
576
|
-
if (j(t),
|
|
576
|
+
if (j(t), I(e), !q(n, Response))
|
|
577
577
|
throw new TypeError('"response" must be an instance of Response');
|
|
578
578
|
if (n.status !== 200) {
|
|
579
579
|
let i;
|
|
@@ -606,7 +606,7 @@ async function be(t, e, n, r = !1, s = !1) {
|
|
|
606
606
|
if (o.id_token !== void 0 && !w(o.id_token))
|
|
607
607
|
throw new a('"response" body "id_token" property must be a non-empty string');
|
|
608
608
|
if (o.id_token) {
|
|
609
|
-
const { claims: i } = await
|
|
609
|
+
const { claims: i } = await Tt(o.id_token, At.bind(void 0, e.id_token_signed_response_alg, t.id_token_signing_alg_values_supported), ke, H(e), tt(e)).then(bt.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(gt.bind(void 0, t.issuer)).then(wt.bind(void 0, e.client_id));
|
|
610
610
|
if (Array.isArray(i.aud) && i.aud.length !== 1 && i.azp !== e.client_id)
|
|
611
611
|
throw new a('unexpected ID Token "azp" (authorized party) claim value');
|
|
612
612
|
if (i.auth_time !== void 0 && (!Number.isFinite(i.auth_time) || Math.sign(i.auth_time) !== 1))
|
|
@@ -637,7 +637,7 @@ function mt(t) {
|
|
|
637
637
|
return ve.add(t), t;
|
|
638
638
|
}
|
|
639
639
|
async function yt(t, e, n, r, s, o) {
|
|
640
|
-
if (j(t),
|
|
640
|
+
if (j(t), I(e), !ve.has(n))
|
|
641
641
|
throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');
|
|
642
642
|
if (!w(r))
|
|
643
643
|
throw new TypeError('"redirectUri" must be a non-empty string');
|
|
@@ -741,7 +741,7 @@ function Se(t) {
|
|
|
741
741
|
throw new S();
|
|
742
742
|
}
|
|
743
743
|
const ke = Symbol();
|
|
744
|
-
async function
|
|
744
|
+
async function Tt(t, e, n, r, s) {
|
|
745
745
|
const { 0: o, 1: i, 2: u, length: g } = t.split(".");
|
|
746
746
|
if (g === 5)
|
|
747
747
|
throw new S("JWE structure JWTs are not supported");
|
|
@@ -749,7 +749,7 @@ async function Et(t, e, n, r, s) {
|
|
|
749
749
|
throw new a("Invalid JWT");
|
|
750
750
|
let m;
|
|
751
751
|
try {
|
|
752
|
-
m = JSON.parse(
|
|
752
|
+
m = JSON.parse(E(T(o)));
|
|
753
753
|
} catch (R) {
|
|
754
754
|
throw new a("failed to parse JWT Header body as base64url encoded JSON", { cause: R });
|
|
755
755
|
}
|
|
@@ -757,17 +757,17 @@ async function Et(t, e, n, r, s) {
|
|
|
757
757
|
throw new a("JWT Header must be a top level object");
|
|
758
758
|
if (e(m), m.crit !== void 0)
|
|
759
759
|
throw new a('unexpected JWT "crit" header parameter');
|
|
760
|
-
const b =
|
|
760
|
+
const b = T(u);
|
|
761
761
|
let _;
|
|
762
762
|
if (n !== ke) {
|
|
763
763
|
_ = await n(m);
|
|
764
764
|
const R = `${o}.${i}`;
|
|
765
|
-
if (!await crypto.subtle.verify(Se(_), _, b,
|
|
765
|
+
if (!await crypto.subtle.verify(Se(_), _, b, E(R)))
|
|
766
766
|
throw new a("JWT signature verification failed");
|
|
767
767
|
}
|
|
768
768
|
let h;
|
|
769
769
|
try {
|
|
770
|
-
h = JSON.parse(
|
|
770
|
+
h = JSON.parse(E(T(i)));
|
|
771
771
|
} catch (R) {
|
|
772
772
|
throw new a("failed to parse JWT Payload body as base64url encoded JSON", { cause: R });
|
|
773
773
|
}
|
|
@@ -794,7 +794,7 @@ async function Et(t, e, n, r, s) {
|
|
|
794
794
|
throw new a('unexpected JWT "aud" (audience) claim type');
|
|
795
795
|
return { header: m, claims: h, signature: b, key: _ };
|
|
796
796
|
}
|
|
797
|
-
function
|
|
797
|
+
function At(t, e, n) {
|
|
798
798
|
if (t !== void 0) {
|
|
799
799
|
if (n.alg !== t)
|
|
800
800
|
throw new a('unexpected JWT "alg" header parameter');
|
|
@@ -814,9 +814,9 @@ function k(t, e) {
|
|
|
814
814
|
throw new a(`"${e}" parameter must be provided only once`);
|
|
815
815
|
return n;
|
|
816
816
|
}
|
|
817
|
-
const
|
|
817
|
+
const Et = Symbol(), Rt = Symbol();
|
|
818
818
|
function Pt(t, e, n, r) {
|
|
819
|
-
if (j(t),
|
|
819
|
+
if (j(t), I(e), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
|
|
820
820
|
throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');
|
|
821
821
|
if (k(n, "response"))
|
|
822
822
|
throw new a('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
|
|
@@ -831,7 +831,7 @@ function Pt(t, e, n, r) {
|
|
|
831
831
|
if (o !== void 0)
|
|
832
832
|
throw new a('unexpected "state" response parameter encountered');
|
|
833
833
|
break;
|
|
834
|
-
case
|
|
834
|
+
case Et:
|
|
835
835
|
break;
|
|
836
836
|
default:
|
|
837
837
|
if (!w(r))
|
|
@@ -863,27 +863,27 @@ class G extends x {
|
|
|
863
863
|
function xt({
|
|
864
864
|
handleCallback: t
|
|
865
865
|
}) {
|
|
866
|
-
const e = je(!1), [n, r] =
|
|
867
|
-
return
|
|
868
|
-
e.current || (e.current = !0, t().then(() => {
|
|
869
|
-
s(
|
|
866
|
+
const e = je(!1), [n, r] = Ie(void 0), s = xe();
|
|
867
|
+
return ze(() => {
|
|
868
|
+
e.current || (e.current = !0, t().then((o) => {
|
|
869
|
+
s(o);
|
|
870
870
|
}).catch((o) => {
|
|
871
871
|
r(o);
|
|
872
872
|
}));
|
|
873
|
-
}, []), n ? n instanceof G ? /* @__PURE__ */
|
|
874
|
-
/* @__PURE__ */
|
|
875
|
-
/* @__PURE__ */
|
|
873
|
+
}, []), n ? n instanceof G ? /* @__PURE__ */ A.jsxs("div", { children: [
|
|
874
|
+
/* @__PURE__ */ A.jsx("h2", { children: "Error" }),
|
|
875
|
+
/* @__PURE__ */ A.jsxs("pre", { children: [
|
|
876
876
|
n.error.error,
|
|
877
877
|
n.error.error_description,
|
|
878
878
|
n.error.error_uri
|
|
879
879
|
] })
|
|
880
|
-
] }) : /* @__PURE__ */
|
|
881
|
-
/* @__PURE__ */
|
|
882
|
-
/* @__PURE__ */
|
|
880
|
+
] }) : /* @__PURE__ */ A.jsxs("div", { children: [
|
|
881
|
+
/* @__PURE__ */ A.jsx("h2", { children: "Error" }),
|
|
882
|
+
/* @__PURE__ */ A.jsxs("pre", { children: [
|
|
883
883
|
n.message,
|
|
884
884
|
n.stack
|
|
885
885
|
] })
|
|
886
|
-
] }) : /* @__PURE__ */
|
|
886
|
+
] }) : /* @__PURE__ */ A.jsx("div", { children: "Loading..." });
|
|
887
887
|
}
|
|
888
888
|
const le = "code-verifier";
|
|
889
889
|
class Ut extends Ce {
|
|
@@ -895,7 +895,7 @@ class Ut extends Ce {
|
|
|
895
895
|
...super.getRoutes(),
|
|
896
896
|
{
|
|
897
897
|
path: this.callbackUrlPath,
|
|
898
|
-
element: /* @__PURE__ */
|
|
898
|
+
element: /* @__PURE__ */ A.jsx(xt, { handleCallback: this.handleCallback })
|
|
899
899
|
}
|
|
900
900
|
];
|
|
901
901
|
}
|
|
@@ -939,7 +939,7 @@ class Lt {
|
|
|
939
939
|
o
|
|
940
940
|
);
|
|
941
941
|
const i = new URL(e);
|
|
942
|
-
i.pathname = this.callbackUrlPath, i.search = "";
|
|
942
|
+
i.pathname = this.redirectToAfterSignIn ?? this.callbackUrlPath, i.search = "";
|
|
943
943
|
const u = await yt(
|
|
944
944
|
s,
|
|
945
945
|
this.client,
|
|
@@ -963,11 +963,11 @@ class Lt {
|
|
|
963
963
|
emailVerified: _.email_verified ?? !1,
|
|
964
964
|
pictureUrl: _.picture
|
|
965
965
|
};
|
|
966
|
-
re.setState({
|
|
966
|
+
return re.setState({
|
|
967
967
|
isAuthenticated: !0,
|
|
968
968
|
isPending: !1,
|
|
969
969
|
profile: h
|
|
970
|
-
});
|
|
970
|
+
}), localStorage.getItem("sign-up") ? this.redirectToAfterSignUp : this.redirectToAfterSignIn;
|
|
971
971
|
});
|
|
972
972
|
this.client = {
|
|
973
973
|
client_id: s,
|
|
@@ -1017,7 +1017,7 @@ class Lt {
|
|
|
1017
1017
|
async authorize(e = !1) {
|
|
1018
1018
|
var g;
|
|
1019
1019
|
const n = "S256", r = await this.getAuthServer();
|
|
1020
|
-
if (!r.authorization_endpoint)
|
|
1020
|
+
if (e ? localStorage.setItem("sign-up", "true") : localStorage.removeItem("sign-up"), !r.authorization_endpoint)
|
|
1021
1021
|
throw new x("No authorization endpoint");
|
|
1022
1022
|
const s = Ge(), o = await Ve(s);
|
|
1023
1023
|
localStorage.setItem(le, s);
|