@ankhorage/studio 0.10.6 → 0.10.8
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/host/layout/templates/auth/adapter.d.ts.map +1 -1
- package/dist/host/layout/templates/auth/adapter.js +13 -7
- package/dist/host/layout/templates/auth/adapter.js.map +1 -1
- package/dist/host/layout/templates/redirect.d.ts.map +1 -1
- package/dist/host/layout/templates/redirect.js +5 -3
- package/dist/host/layout/templates/redirect.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../../src/host/layout/templates/auth/adapter.ts"],"names":[],"mappings":"AAAA,UAAU,0BAA0B;IAClC,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC,QAAQ,GAAG,OAAO,CAAC,EAAE,CAAC;CAC3D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,0BAA+B,
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../../src/host/layout/templates/auth/adapter.ts"],"names":[],"mappings":"AAAA,UAAU,0BAA0B;IAClC,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC,QAAQ,GAAG,OAAO,CAAC,EAAE,CAAC;CAC3D;AAED,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,0BAA+B,UA4DxE"}
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
export function getAuthAdapterTs(options = {}) {
|
|
2
|
-
const oauthProviders =
|
|
2
|
+
const oauthProviders = options.oauthProviders ?? [];
|
|
3
|
+
const oauthProviderDeclaration = oauthProviders.length > 0
|
|
4
|
+
? `const generatedOAuthProviders = ${JSON.stringify(oauthProviders)} as const;\n\n`
|
|
5
|
+
: '';
|
|
6
|
+
const oauthProviderProperty = oauthProviders.length > 0 ? '\n oauthProviders: generatedOAuthProviders,' : '';
|
|
3
7
|
return `import type { AuthAdapter, AuthResult, AuthSession, AuthUser } from '@ankhorage/contracts/auth';
|
|
4
8
|
import { createSupabaseAuthAdapter } from '@ankhorage/supabase-auth';
|
|
5
9
|
|
|
6
10
|
import { AUTH_SESSION_STORAGE_KEY, authSessionStorage } from './session';
|
|
7
11
|
|
|
8
|
-
const
|
|
12
|
+
declare const process: {
|
|
13
|
+
readonly env: {
|
|
14
|
+
readonly EXPO_PUBLIC_SUPABASE_URL?: string;
|
|
15
|
+
readonly EXPO_PUBLIC_SUPABASE_ANON_KEY?: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
9
18
|
|
|
10
|
-
const supabaseUrl = process.env.EXPO_PUBLIC_SUPABASE_URL?.trim() ?? '';
|
|
19
|
+
${oauthProviderDeclaration}const supabaseUrl = process.env.EXPO_PUBLIC_SUPABASE_URL?.trim() ?? '';
|
|
11
20
|
const supabaseAnonKey = process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY?.trim() ?? '';
|
|
12
21
|
|
|
13
22
|
export const authAdapter: AuthAdapter =
|
|
@@ -16,10 +25,7 @@ export const authAdapter: AuthAdapter =
|
|
|
16
25
|
url: supabaseUrl,
|
|
17
26
|
anonKey: supabaseAnonKey,
|
|
18
27
|
storage: authSessionStorage,
|
|
19
|
-
storageKey: AUTH_SESSION_STORAGE_KEY
|
|
20
|
-
...(generatedOAuthProviders.length > 0
|
|
21
|
-
? { oauthProviders: generatedOAuthProviders }
|
|
22
|
-
: {}),
|
|
28
|
+
storageKey: AUTH_SESSION_STORAGE_KEY,${oauthProviderProperty}
|
|
23
29
|
})
|
|
24
30
|
: createMissingSupabaseAuthAdapter();
|
|
25
31
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../../../src/host/layout/templates/auth/adapter.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,gBAAgB,CAAC,UAAsC,EAAE;IACvE,MAAM,cAAc,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../../../src/host/layout/templates/auth/adapter.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,gBAAgB,CAAC,UAAsC,EAAE;IACvE,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,IAAI,EAAE,CAAC;IACpD,MAAM,wBAAwB,GAC5B,cAAc,CAAC,MAAM,GAAG,CAAC;QACvB,CAAC,CAAC,mCAAmC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,gBAAgB;QACnF,CAAC,CAAC,EAAE,CAAC;IACT,MAAM,qBAAqB,GACzB,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,oDAAoD,CAAC,CAAC,CAAC,EAAE,CAAC;IAExF,OAAO;;;;;;;;;;;;EAYP,wBAAwB;;;;;;;;;+CASqB,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BnE,CAAC;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redirect.d.ts","sourceRoot":"","sources":["../../../../src/host/layout/templates/redirect.ts"],"names":[],"mappings":"AAEA,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"redirect.d.ts","sourceRoot":"","sources":["../../../../src/host/layout/templates/redirect.ts"],"names":[],"mappings":"AAEA,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAS7D"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { escapeStringLiteral } from '../utils/escapeStringLiteral';
|
|
2
2
|
export function getIndexRedirectRouteTsx(href) {
|
|
3
|
-
return
|
|
4
|
-
|
|
3
|
+
return `/**
|
|
4
|
+
* The root layout owns auth bootstrap and canonicalizes / to '${escapeStringLiteral(href)}'.
|
|
5
|
+
* This route only keeps / matchable without creating synthetic navigation history.
|
|
6
|
+
*/
|
|
5
7
|
export default function IndexRoute() {
|
|
6
|
-
return
|
|
8
|
+
return null;
|
|
7
9
|
}
|
|
8
10
|
`;
|
|
9
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redirect.js","sourceRoot":"","sources":["../../../../src/host/layout/templates/redirect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,MAAM,UAAU,wBAAwB,CAAC,IAAY;IACnD,OAAO
|
|
1
|
+
{"version":3,"file":"redirect.js","sourceRoot":"","sources":["../../../../src/host/layout/templates/redirect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,MAAM,UAAU,wBAAwB,CAAC,IAAY;IACnD,OAAO;iEACwD,mBAAmB,CAAC,IAAI,CAAC;;;;;;CAMzF,CAAC;AACF,CAAC"}
|