@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 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
@@ -10,7 +10,7 @@ import {
10
10
  isNetworkError,
11
11
  shouldRefreshSoon,
12
12
  storedSessionSchema
13
- } from "./chunk-PDX2IQJO.js";
13
+ } from "./chunk-GVFTISVO.js";
14
14
  import "./chunk-7XJGOKEO.js";
15
15
  export {
16
16
  RemixAuthContinuationError,
@@ -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 ?? "google" } : { returnTo: normalizeBrowserReturnTo(params.redirectTo), provider: params.provider ?? "google" };
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
@@ -13,7 +13,7 @@ import {
13
13
  isNetworkError,
14
14
  shouldRefreshSoon,
15
15
  storedSessionSchema
16
- } from "./chunk-PDX2IQJO.js";
16
+ } from "./chunk-GVFTISVO.js";
17
17
  import {
18
18
  configSchema,
19
19
  resolveConfig
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remixhq/core",
3
- "version": "0.1.44",
3
+ "version": "0.1.45",
4
4
  "description": "Remix core library",
5
5
  "homepage": "https://github.com/RemixDotOne/remix-core",
6
6
  "license": "MIT",