@remixhq/core 0.1.44 → 0.1.45
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/auth.d.ts +8 -1
- package/dist/auth.js +1 -1
- package/dist/{chunk-PDX2IQJO.js → chunk-GVFTISVO.js} +4 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/auth.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ declare function createDefaultRefreshLock(filePath?: string): WithRefreshLock;
|
|
|
47
47
|
declare function isNetworkError(err: unknown): boolean;
|
|
48
48
|
declare function isInvalidGrantError(err: unknown): boolean;
|
|
49
49
|
|
|
50
|
-
type RemixAuthProvider = "google" | "github";
|
|
50
|
+
type RemixAuthProvider = "authkit" | "google" | "github";
|
|
51
51
|
type WorkosAuthOrganization = {
|
|
52
52
|
id: string;
|
|
53
53
|
name?: string | null;
|
|
@@ -103,6 +103,13 @@ type RemixAuthHelpers = {
|
|
|
103
103
|
url: string;
|
|
104
104
|
codeVerifier?: string;
|
|
105
105
|
}>;
|
|
106
|
+
startAuthKitLogin(params: {
|
|
107
|
+
redirectTo: string;
|
|
108
|
+
state?: string;
|
|
109
|
+
}): Promise<{
|
|
110
|
+
url: string;
|
|
111
|
+
codeVerifier?: string;
|
|
112
|
+
}>;
|
|
106
113
|
startGoogleLogin(params: {
|
|
107
114
|
redirectTo: string;
|
|
108
115
|
state?: string;
|
package/dist/auth.js
CHANGED
|
@@ -359,13 +359,16 @@ function createRemixAuthHelpers(config) {
|
|
|
359
359
|
async function startLogin(params) {
|
|
360
360
|
const path3 = params.state ? "/v1/auth/cli/login-url" : "/v1/auth/login-url";
|
|
361
361
|
const pkce = params.state ? createPkcePair() : null;
|
|
362
|
-
const body = params.state ? { returnTo: params.redirectTo, state: params.state, codeChallenge: pkce?.codeChallenge, provider: params.provider ?? "
|
|
362
|
+
const body = params.state ? { returnTo: params.redirectTo, state: params.state, codeChallenge: pkce?.codeChallenge, provider: params.provider ?? "authkit" } : { returnTo: normalizeBrowserReturnTo(params.redirectTo), provider: params.provider ?? "authkit" };
|
|
363
363
|
const result = await postBackend(config, path3, body, params.state ? void 0 : { credentials: "include" });
|
|
364
364
|
if (!result.url) throw new RemixError("Remix backend did not return an auth URL.", { exitCode: 1 });
|
|
365
365
|
return pkce ? { url: result.url, codeVerifier: pkce.codeVerifier } : { url: result.url };
|
|
366
366
|
}
|
|
367
367
|
return {
|
|
368
368
|
startLogin,
|
|
369
|
+
async startAuthKitLogin(params) {
|
|
370
|
+
return startLogin({ ...params, provider: "authkit" });
|
|
371
|
+
},
|
|
369
372
|
async startGoogleLogin(params) {
|
|
370
373
|
return startLogin({ ...params, provider: "google" });
|
|
371
374
|
},
|
package/dist/index.js
CHANGED