zitejs 0.9.76 → 0.9.78
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/cjs/auth/index.d.ts +50 -0
- package/dist/cjs/auth/index.js +2 -0
- package/dist/cjs/auth/index.test.d.ts +1 -0
- package/dist/cjs/auth/index.test.js +64 -0
- package/dist/cjs/auth-server/index.d.ts +2 -6
- package/dist/cjs/sync/lib.js +18 -2
- package/dist/cjs/sync/lib.test.d.ts +1 -0
- package/dist/cjs/sync/lib.test.js +38 -0
- package/dist/esm/auth/index.d.ts +50 -0
- package/dist/esm/auth/index.js +2 -0
- package/dist/esm/auth/index.test.d.ts +1 -0
- package/dist/esm/auth/index.test.js +29 -0
- package/dist/esm/auth-server/index.d.ts +2 -6
- package/dist/esm/sync/lib.js +18 -2
- package/dist/esm/sync/lib.test.d.ts +1 -0
- package/dist/esm/sync/lib.test.js +36 -0
- package/package.json +1 -1
package/dist/cjs/auth/index.d.ts
CHANGED
|
@@ -27,6 +27,29 @@ export declare const useSession: () => {
|
|
|
27
27
|
query?: import("better-auth/types").SessionQueryParams;
|
|
28
28
|
} | undefined) => Promise<void>;
|
|
29
29
|
}, signIn: {
|
|
30
|
+
magicLink: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
|
|
31
|
+
email: string;
|
|
32
|
+
name?: string | undefined;
|
|
33
|
+
callbackURL?: string | undefined;
|
|
34
|
+
newUserCallbackURL?: string | undefined;
|
|
35
|
+
errorCallbackURL?: string | undefined;
|
|
36
|
+
metadata?: Record<string, any> | undefined;
|
|
37
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
|
|
38
|
+
email: string;
|
|
39
|
+
name?: string | undefined;
|
|
40
|
+
callbackURL?: string | undefined;
|
|
41
|
+
newUserCallbackURL?: string | undefined;
|
|
42
|
+
errorCallbackURL?: string | undefined;
|
|
43
|
+
metadata?: Record<string, any> | undefined;
|
|
44
|
+
} & {
|
|
45
|
+
fetchOptions?: FetchOptions | undefined;
|
|
46
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
|
|
47
|
+
status: boolean;
|
|
48
|
+
}, {
|
|
49
|
+
code?: string | undefined;
|
|
50
|
+
message?: string | undefined;
|
|
51
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
52
|
+
} & {
|
|
30
53
|
social: <FetchOptions extends import("@better-auth/core").ClientFetchOption<Partial<{
|
|
31
54
|
provider: (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
|
|
32
55
|
callbackURL?: string | undefined;
|
|
@@ -235,3 +258,30 @@ export type User = {
|
|
|
235
258
|
createdAt: Date;
|
|
236
259
|
updatedAt: Date;
|
|
237
260
|
};
|
|
261
|
+
export interface ZiteAuthMethods {
|
|
262
|
+
emailPassword?: boolean;
|
|
263
|
+
magicLink?: boolean;
|
|
264
|
+
googleSignIn?: boolean;
|
|
265
|
+
sso?: boolean;
|
|
266
|
+
}
|
|
267
|
+
export interface ZiteAuthPageMessages {
|
|
268
|
+
signInTitle?: string;
|
|
269
|
+
signUpTitle?: string;
|
|
270
|
+
signInSubtitle?: string;
|
|
271
|
+
signUpSubtitle?: string;
|
|
272
|
+
}
|
|
273
|
+
export interface ZiteAuthPage {
|
|
274
|
+
showLogo?: boolean;
|
|
275
|
+
messages?: ZiteAuthPageMessages;
|
|
276
|
+
}
|
|
277
|
+
export interface ZiteAuthenticationConfig {
|
|
278
|
+
authenticationMethods?: ZiteAuthMethods;
|
|
279
|
+
signup?: 'disabled' | 'open' | 'domain-restricted';
|
|
280
|
+
domains?: string[];
|
|
281
|
+
authPage?: ZiteAuthPage;
|
|
282
|
+
}
|
|
283
|
+
export interface ZiteAppConfig {
|
|
284
|
+
id?: string;
|
|
285
|
+
accessMode?: string;
|
|
286
|
+
authentication?: ZiteAuthenticationConfig;
|
|
287
|
+
}
|
package/dist/cjs/auth/index.js
CHANGED
|
@@ -4,8 +4,10 @@ exports.signUp = exports.signOut = exports.signIn = exports.useSession = void 0;
|
|
|
4
4
|
exports.loginWithRedirect = loginWithRedirect;
|
|
5
5
|
exports.logout = logout;
|
|
6
6
|
const react_1 = require("better-auth/react");
|
|
7
|
+
const plugins_1 = require("better-auth/client/plugins");
|
|
7
8
|
const authClient = (0, react_1.createAuthClient)({
|
|
8
9
|
baseURL: '',
|
|
10
|
+
plugins: [(0, plugins_1.magicLinkClient)()],
|
|
9
11
|
});
|
|
10
12
|
exports.useSession = authClient.useSession, exports.signIn = authClient.signIn, exports.signOut = authClient.signOut, exports.signUp = authClient.signUp;
|
|
11
13
|
function loginWithRedirect(opts) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const vitest_1 = require("vitest");
|
|
37
|
+
const authExports = __importStar(require("./index.js"));
|
|
38
|
+
(0, vitest_1.describe)('zitejs/auth exports', () => {
|
|
39
|
+
(0, vitest_1.it)('exports loginWithRedirect as a function', () => {
|
|
40
|
+
(0, vitest_1.expect)(typeof authExports.loginWithRedirect).toBe('function');
|
|
41
|
+
});
|
|
42
|
+
(0, vitest_1.it)('exports logout as a function', () => {
|
|
43
|
+
(0, vitest_1.expect)(typeof authExports.logout).toBe('function');
|
|
44
|
+
});
|
|
45
|
+
(0, vitest_1.it)('exports useSession', () => {
|
|
46
|
+
(0, vitest_1.expect)(authExports.useSession).toBeDefined();
|
|
47
|
+
});
|
|
48
|
+
(0, vitest_1.it)('exports signIn with magicLink method (from magicLinkClient plugin)', () => {
|
|
49
|
+
(0, vitest_1.expect)(authExports.signIn).toBeDefined();
|
|
50
|
+
(0, vitest_1.expect)(typeof authExports.signIn.magicLink).toBe('function');
|
|
51
|
+
});
|
|
52
|
+
(0, vitest_1.it)('exports signIn with email method', () => {
|
|
53
|
+
(0, vitest_1.expect)(typeof authExports.signIn.email).toBe('function');
|
|
54
|
+
});
|
|
55
|
+
(0, vitest_1.it)('exports signIn with social method', () => {
|
|
56
|
+
(0, vitest_1.expect)(typeof authExports.signIn.social).toBe('function');
|
|
57
|
+
});
|
|
58
|
+
(0, vitest_1.it)('exports signUp with email method', () => {
|
|
59
|
+
(0, vitest_1.expect)(typeof authExports.signUp.email).toBe('function');
|
|
60
|
+
});
|
|
61
|
+
(0, vitest_1.it)('exports signOut', () => {
|
|
62
|
+
(0, vitest_1.expect)(authExports.signOut).toBeDefined();
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -5,12 +5,8 @@ export interface ZiteAuthUser {
|
|
|
5
5
|
firstName?: string;
|
|
6
6
|
lastName?: string;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
magicLink?: boolean;
|
|
11
|
-
googleSignIn?: boolean;
|
|
12
|
-
sso?: boolean;
|
|
13
|
-
}
|
|
8
|
+
import type { ZiteAuthMethods } from '../auth/index.js';
|
|
9
|
+
export type { ZiteAuthMethods };
|
|
14
10
|
export interface ZiteAuthSettings {
|
|
15
11
|
methods?: ZiteAuthMethods;
|
|
16
12
|
signup?: 'disabled' | 'open' | 'domain-restricted';
|
package/dist/cjs/sync/lib.js
CHANGED
|
@@ -494,9 +494,25 @@ function generateAuthWrapperTs() {
|
|
|
494
494
|
return [
|
|
495
495
|
"// Auto-generated auth re-exports. Do not edit manually.",
|
|
496
496
|
"// The real auth logic lives in the zitejs npm package (zitejs/auth).",
|
|
497
|
+
"// Imports use zitejs/auth/base to avoid circular alias (zitejs/auth → this file).",
|
|
497
498
|
"",
|
|
498
|
-
"export {
|
|
499
|
-
"
|
|
499
|
+
"export {",
|
|
500
|
+
" useSession,",
|
|
501
|
+
" signIn,",
|
|
502
|
+
" signOut,",
|
|
503
|
+
" signUp,",
|
|
504
|
+
" loginWithRedirect,",
|
|
505
|
+
" logout,",
|
|
506
|
+
"} from 'zitejs/auth/base';",
|
|
507
|
+
"",
|
|
508
|
+
"export type {",
|
|
509
|
+
" User,",
|
|
510
|
+
" ZiteAppConfig,",
|
|
511
|
+
" ZiteAuthenticationConfig,",
|
|
512
|
+
" ZiteAuthMethods,",
|
|
513
|
+
" ZiteAuthPage,",
|
|
514
|
+
" ZiteAuthPageMessages,",
|
|
515
|
+
"} from 'zitejs/auth/base';",
|
|
500
516
|
"",
|
|
501
517
|
].join("\n");
|
|
502
518
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const lib_js_1 = require("./lib.js");
|
|
5
|
+
(0, vitest_1.describe)('generateAuthWrapperTs', () => {
|
|
6
|
+
const output = (0, lib_js_1.generateAuthWrapperTs)();
|
|
7
|
+
(0, vitest_1.it)('imports from zitejs/auth/base (not zitejs/auth) to avoid circular alias', () => {
|
|
8
|
+
(0, vitest_1.expect)(output).toContain("from 'zitejs/auth/base'");
|
|
9
|
+
(0, vitest_1.expect)(output).not.toContain("from 'zitejs/auth';");
|
|
10
|
+
});
|
|
11
|
+
(0, vitest_1.it)('re-exports all auth runtime functions', () => {
|
|
12
|
+
for (const fn of [
|
|
13
|
+
'useSession',
|
|
14
|
+
'signIn',
|
|
15
|
+
'signOut',
|
|
16
|
+
'signUp',
|
|
17
|
+
'loginWithRedirect',
|
|
18
|
+
'logout',
|
|
19
|
+
]) {
|
|
20
|
+
(0, vitest_1.expect)(output).toContain(fn);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
(0, vitest_1.it)('re-exports all config types', () => {
|
|
24
|
+
for (const type of [
|
|
25
|
+
'User',
|
|
26
|
+
'ZiteAppConfig',
|
|
27
|
+
'ZiteAuthenticationConfig',
|
|
28
|
+
'ZiteAuthMethods',
|
|
29
|
+
'ZiteAuthPage',
|
|
30
|
+
'ZiteAuthPageMessages',
|
|
31
|
+
]) {
|
|
32
|
+
(0, vitest_1.expect)(output).toContain(type);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
(0, vitest_1.it)('does not export the old useAuth function', () => {
|
|
36
|
+
(0, vitest_1.expect)(output).not.toContain('useAuth');
|
|
37
|
+
});
|
|
38
|
+
});
|
package/dist/esm/auth/index.d.ts
CHANGED
|
@@ -27,6 +27,29 @@ export declare const useSession: () => {
|
|
|
27
27
|
query?: import("better-auth").SessionQueryParams;
|
|
28
28
|
} | undefined) => Promise<void>;
|
|
29
29
|
}, signIn: {
|
|
30
|
+
magicLink: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
|
|
31
|
+
email: string;
|
|
32
|
+
name?: string | undefined;
|
|
33
|
+
callbackURL?: string | undefined;
|
|
34
|
+
newUserCallbackURL?: string | undefined;
|
|
35
|
+
errorCallbackURL?: string | undefined;
|
|
36
|
+
metadata?: Record<string, any> | undefined;
|
|
37
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
|
|
38
|
+
email: string;
|
|
39
|
+
name?: string | undefined;
|
|
40
|
+
callbackURL?: string | undefined;
|
|
41
|
+
newUserCallbackURL?: string | undefined;
|
|
42
|
+
errorCallbackURL?: string | undefined;
|
|
43
|
+
metadata?: Record<string, any> | undefined;
|
|
44
|
+
} & {
|
|
45
|
+
fetchOptions?: FetchOptions | undefined;
|
|
46
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
|
|
47
|
+
status: boolean;
|
|
48
|
+
}, {
|
|
49
|
+
code?: string | undefined;
|
|
50
|
+
message?: string | undefined;
|
|
51
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
52
|
+
} & {
|
|
30
53
|
social: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
|
|
31
54
|
provider: (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
|
|
32
55
|
callbackURL?: string | undefined;
|
|
@@ -235,3 +258,30 @@ export type User = {
|
|
|
235
258
|
createdAt: Date;
|
|
236
259
|
updatedAt: Date;
|
|
237
260
|
};
|
|
261
|
+
export interface ZiteAuthMethods {
|
|
262
|
+
emailPassword?: boolean;
|
|
263
|
+
magicLink?: boolean;
|
|
264
|
+
googleSignIn?: boolean;
|
|
265
|
+
sso?: boolean;
|
|
266
|
+
}
|
|
267
|
+
export interface ZiteAuthPageMessages {
|
|
268
|
+
signInTitle?: string;
|
|
269
|
+
signUpTitle?: string;
|
|
270
|
+
signInSubtitle?: string;
|
|
271
|
+
signUpSubtitle?: string;
|
|
272
|
+
}
|
|
273
|
+
export interface ZiteAuthPage {
|
|
274
|
+
showLogo?: boolean;
|
|
275
|
+
messages?: ZiteAuthPageMessages;
|
|
276
|
+
}
|
|
277
|
+
export interface ZiteAuthenticationConfig {
|
|
278
|
+
authenticationMethods?: ZiteAuthMethods;
|
|
279
|
+
signup?: 'disabled' | 'open' | 'domain-restricted';
|
|
280
|
+
domains?: string[];
|
|
281
|
+
authPage?: ZiteAuthPage;
|
|
282
|
+
}
|
|
283
|
+
export interface ZiteAppConfig {
|
|
284
|
+
id?: string;
|
|
285
|
+
accessMode?: string;
|
|
286
|
+
authentication?: ZiteAuthenticationConfig;
|
|
287
|
+
}
|
package/dist/esm/auth/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { createAuthClient } from 'better-auth/react';
|
|
2
|
+
import { magicLinkClient } from 'better-auth/client/plugins';
|
|
2
3
|
const authClient = createAuthClient({
|
|
3
4
|
baseURL: '',
|
|
5
|
+
plugins: [magicLinkClient()],
|
|
4
6
|
});
|
|
5
7
|
export const { useSession, signIn, signOut, signUp } = authClient;
|
|
6
8
|
export function loginWithRedirect(opts) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import * as authExports from './index.js';
|
|
3
|
+
describe('zitejs/auth exports', () => {
|
|
4
|
+
it('exports loginWithRedirect as a function', () => {
|
|
5
|
+
expect(typeof authExports.loginWithRedirect).toBe('function');
|
|
6
|
+
});
|
|
7
|
+
it('exports logout as a function', () => {
|
|
8
|
+
expect(typeof authExports.logout).toBe('function');
|
|
9
|
+
});
|
|
10
|
+
it('exports useSession', () => {
|
|
11
|
+
expect(authExports.useSession).toBeDefined();
|
|
12
|
+
});
|
|
13
|
+
it('exports signIn with magicLink method (from magicLinkClient plugin)', () => {
|
|
14
|
+
expect(authExports.signIn).toBeDefined();
|
|
15
|
+
expect(typeof authExports.signIn.magicLink).toBe('function');
|
|
16
|
+
});
|
|
17
|
+
it('exports signIn with email method', () => {
|
|
18
|
+
expect(typeof authExports.signIn.email).toBe('function');
|
|
19
|
+
});
|
|
20
|
+
it('exports signIn with social method', () => {
|
|
21
|
+
expect(typeof authExports.signIn.social).toBe('function');
|
|
22
|
+
});
|
|
23
|
+
it('exports signUp with email method', () => {
|
|
24
|
+
expect(typeof authExports.signUp.email).toBe('function');
|
|
25
|
+
});
|
|
26
|
+
it('exports signOut', () => {
|
|
27
|
+
expect(authExports.signOut).toBeDefined();
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -5,12 +5,8 @@ export interface ZiteAuthUser {
|
|
|
5
5
|
firstName?: string;
|
|
6
6
|
lastName?: string;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
magicLink?: boolean;
|
|
11
|
-
googleSignIn?: boolean;
|
|
12
|
-
sso?: boolean;
|
|
13
|
-
}
|
|
8
|
+
import type { ZiteAuthMethods } from '../auth/index.js';
|
|
9
|
+
export type { ZiteAuthMethods };
|
|
14
10
|
export interface ZiteAuthSettings {
|
|
15
11
|
methods?: ZiteAuthMethods;
|
|
16
12
|
signup?: 'disabled' | 'open' | 'domain-restricted';
|
package/dist/esm/sync/lib.js
CHANGED
|
@@ -482,9 +482,25 @@ export function generateAuthWrapperTs() {
|
|
|
482
482
|
return [
|
|
483
483
|
"// Auto-generated auth re-exports. Do not edit manually.",
|
|
484
484
|
"// The real auth logic lives in the zitejs npm package (zitejs/auth).",
|
|
485
|
+
"// Imports use zitejs/auth/base to avoid circular alias (zitejs/auth → this file).",
|
|
485
486
|
"",
|
|
486
|
-
"export {
|
|
487
|
-
"
|
|
487
|
+
"export {",
|
|
488
|
+
" useSession,",
|
|
489
|
+
" signIn,",
|
|
490
|
+
" signOut,",
|
|
491
|
+
" signUp,",
|
|
492
|
+
" loginWithRedirect,",
|
|
493
|
+
" logout,",
|
|
494
|
+
"} from 'zitejs/auth/base';",
|
|
495
|
+
"",
|
|
496
|
+
"export type {",
|
|
497
|
+
" User,",
|
|
498
|
+
" ZiteAppConfig,",
|
|
499
|
+
" ZiteAuthenticationConfig,",
|
|
500
|
+
" ZiteAuthMethods,",
|
|
501
|
+
" ZiteAuthPage,",
|
|
502
|
+
" ZiteAuthPageMessages,",
|
|
503
|
+
"} from 'zitejs/auth/base';",
|
|
488
504
|
"",
|
|
489
505
|
].join("\n");
|
|
490
506
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { generateAuthWrapperTs } from './lib.js';
|
|
3
|
+
describe('generateAuthWrapperTs', () => {
|
|
4
|
+
const output = generateAuthWrapperTs();
|
|
5
|
+
it('imports from zitejs/auth/base (not zitejs/auth) to avoid circular alias', () => {
|
|
6
|
+
expect(output).toContain("from 'zitejs/auth/base'");
|
|
7
|
+
expect(output).not.toContain("from 'zitejs/auth';");
|
|
8
|
+
});
|
|
9
|
+
it('re-exports all auth runtime functions', () => {
|
|
10
|
+
for (const fn of [
|
|
11
|
+
'useSession',
|
|
12
|
+
'signIn',
|
|
13
|
+
'signOut',
|
|
14
|
+
'signUp',
|
|
15
|
+
'loginWithRedirect',
|
|
16
|
+
'logout',
|
|
17
|
+
]) {
|
|
18
|
+
expect(output).toContain(fn);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
it('re-exports all config types', () => {
|
|
22
|
+
for (const type of [
|
|
23
|
+
'User',
|
|
24
|
+
'ZiteAppConfig',
|
|
25
|
+
'ZiteAuthenticationConfig',
|
|
26
|
+
'ZiteAuthMethods',
|
|
27
|
+
'ZiteAuthPage',
|
|
28
|
+
'ZiteAuthPageMessages',
|
|
29
|
+
]) {
|
|
30
|
+
expect(output).toContain(type);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
it('does not export the old useAuth function', () => {
|
|
34
|
+
expect(output).not.toContain('useAuth');
|
|
35
|
+
});
|
|
36
|
+
});
|