@witchcraft/nuxt-auth 0.1.3 → 0.1.4
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/module.json +1 -1
- package/dist/module.mjs +2 -5
- package/dist/runtime/components/ExternalCallback.d.vue.ts +2 -1
- package/dist/runtime/components/ExternalCallback.vue.d.ts +2 -1
- package/dist/runtime/components/ExternalCode.d.vue.ts +2 -1
- package/dist/runtime/components/ExternalCode.vue.d.ts +2 -1
- package/dist/runtime/components/LoginProviderButtons.client.d.vue.ts +2 -1
- package/dist/runtime/components/LoginProviderButtons.client.vue.d.ts +2 -1
- package/dist/runtime/components/Mocker.d.vue.ts +2 -1
- package/dist/runtime/components/Mocker.vue.d.ts +2 -1
- package/dist/runtime/components/SessionStatus.d.vue.ts +3 -2
- package/dist/runtime/components/SessionStatus.vue.d.ts +3 -2
- package/dist/runtime/components/UserRegistration.d.vue.ts +3 -2
- package/dist/runtime/components/UserRegistration.vue.d.ts +3 -2
- package/dist/runtime/server/utils/Auth.js +3 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -74,11 +74,8 @@ const module = defineNuxtModule({
|
|
|
74
74
|
prefix: "Auth",
|
|
75
75
|
global: true
|
|
76
76
|
});
|
|
77
|
-
if (!process.env.NUXT_AUTH_SECRET) {
|
|
78
|
-
logger.
|
|
79
|
-
}
|
|
80
|
-
if (process.env.NUXT_AUTH_SECRET && process.env.NUXT_AUTH_SECRET.length === 0) {
|
|
81
|
-
logger.warn("$NUXT_AUTH_SECRET is empty. This is not recommended.");
|
|
77
|
+
if (process.env.NODE_ENV !== "production" && (!process.env.NUXT_AUTH_SECRET || process.env.NUXT_AUTH_SECRET && process.env.NUXT_AUTH_SECRET.length === 0)) {
|
|
78
|
+
logger.warn("$NUXT_AUTH_SECRET is missing or empty. This is not recommended.");
|
|
82
79
|
}
|
|
83
80
|
nuxt.options.runtimeConfig.public.auth = defu(
|
|
84
81
|
nuxt.options.runtimeConfig.public.auth,
|
|
@@ -3,5 +3,6 @@ type __VLS_Props = {
|
|
|
3
3
|
successPath?: string;
|
|
4
4
|
cancelPath?: string;
|
|
5
5
|
};
|
|
6
|
-
declare const
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
7
8
|
export default _default;
|
|
@@ -3,5 +3,6 @@ type __VLS_Props = {
|
|
|
3
3
|
successPath?: string;
|
|
4
4
|
cancelPath?: string;
|
|
5
5
|
};
|
|
6
|
-
declare const
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
7
8
|
export default _default;
|
|
@@ -3,9 +3,10 @@ type __VLS_Props = {
|
|
|
3
3
|
promptText?: string;
|
|
4
4
|
copyTitle?: string;
|
|
5
5
|
};
|
|
6
|
-
declare const
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
7
7
|
openAppText: string;
|
|
8
8
|
promptText: string;
|
|
9
9
|
copyTitle: string;
|
|
10
10
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
11
12
|
export default _default;
|
|
@@ -3,9 +3,10 @@ type __VLS_Props = {
|
|
|
3
3
|
promptText?: string;
|
|
4
4
|
copyTitle?: string;
|
|
5
5
|
};
|
|
6
|
-
declare const
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
7
7
|
openAppText: string;
|
|
8
8
|
promptText: string;
|
|
9
9
|
copyTitle: string;
|
|
10
10
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
11
12
|
export default _default;
|
|
@@ -5,11 +5,12 @@ type __VLS_Props = {
|
|
|
5
5
|
useAuthOptions?: UseAuthComposableOptions;
|
|
6
6
|
loginOptions?: Parameters<ReturnType<typeof useAuth>["login"]>[1];
|
|
7
7
|
};
|
|
8
|
-
declare const
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
9
|
providerStyles: Record<ProviderNames, Partial<ProviderStyle>>;
|
|
10
10
|
useAuthOptions: UseAuthComposableOptions;
|
|
11
11
|
loginOptions: {
|
|
12
12
|
devBypass?: boolean;
|
|
13
13
|
};
|
|
14
14
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
15
16
|
export default _default;
|
|
@@ -5,11 +5,12 @@ type __VLS_Props = {
|
|
|
5
5
|
useAuthOptions?: UseAuthComposableOptions;
|
|
6
6
|
loginOptions?: Parameters<ReturnType<typeof useAuth>["login"]>[1];
|
|
7
7
|
};
|
|
8
|
-
declare const
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
9
|
providerStyles: Record<ProviderNames, Partial<ProviderStyle>>;
|
|
10
10
|
useAuthOptions: UseAuthComposableOptions;
|
|
11
11
|
loginOptions: {
|
|
12
12
|
devBypass?: boolean;
|
|
13
13
|
};
|
|
14
14
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
15
16
|
export default _default;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
2
3
|
export default _default;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
2
3
|
export default _default;
|
|
@@ -23,10 +23,11 @@ type __VLS_Slots = {} & {
|
|
|
23
23
|
} & {
|
|
24
24
|
unauthenticated?: (props: typeof __VLS_33) => any;
|
|
25
25
|
};
|
|
26
|
-
declare const
|
|
26
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
27
27
|
usernameLink: (user: AuthUser) => string;
|
|
28
28
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
|
-
declare const
|
|
29
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
30
31
|
export default _default;
|
|
31
32
|
type __VLS_WithSlots<T, S> = T & {
|
|
32
33
|
new (): {
|
|
@@ -23,10 +23,11 @@ type __VLS_Slots = {} & {
|
|
|
23
23
|
} & {
|
|
24
24
|
unauthenticated?: (props: typeof __VLS_33) => any;
|
|
25
25
|
};
|
|
26
|
-
declare const
|
|
26
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
27
27
|
usernameLink: (user: AuthUser) => string;
|
|
28
28
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
|
-
declare const
|
|
29
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
30
31
|
export default _default;
|
|
31
32
|
type __VLS_WithSlots<T, S> = T & {
|
|
32
33
|
new (): {
|
|
@@ -21,12 +21,13 @@ type __VLS_Slots = {} & {
|
|
|
21
21
|
} & {
|
|
22
22
|
error?: (props: typeof __VLS_45) => any;
|
|
23
23
|
};
|
|
24
|
-
declare const
|
|
24
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
25
25
|
debounce: number;
|
|
26
26
|
getValidUsernameRoute: (username: string) => string;
|
|
27
27
|
onSubmitRegistration: (event: Event, username: string, error: Ref<string>, redirectUrl: string, deeplink?: string) => void;
|
|
28
28
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
|
-
declare const
|
|
29
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
30
31
|
export default _default;
|
|
31
32
|
type __VLS_WithSlots<T, S> = T & {
|
|
32
33
|
new (): {
|
|
@@ -21,12 +21,13 @@ type __VLS_Slots = {} & {
|
|
|
21
21
|
} & {
|
|
22
22
|
error?: (props: typeof __VLS_45) => any;
|
|
23
23
|
};
|
|
24
|
-
declare const
|
|
24
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
25
25
|
debounce: number;
|
|
26
26
|
getValidUsernameRoute: (username: string) => string;
|
|
27
27
|
onSubmitRegistration: (event: Event, username: string, error: Ref<string>, redirectUrl: string, deeplink?: string) => void;
|
|
28
28
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
|
-
declare const
|
|
29
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
30
31
|
export default _default;
|
|
31
32
|
type __VLS_WithSlots<T, S> = T & {
|
|
32
33
|
new (): {
|
|
@@ -69,6 +69,9 @@ export class Auth {
|
|
|
69
69
|
providerCookieOpts;
|
|
70
70
|
constructor(runtimeConfig, db, usersTable, authAccountsTable, sessionManager, router, opts, env, logger) {
|
|
71
71
|
this.rc = runtimeConfig;
|
|
72
|
+
if (!import.meta.dev && !(this.rc.authSecret || this.rc.authSecret.length === 0)) {
|
|
73
|
+
throw new Error("FATAL: Missing or empty runtimeConfig.authSecret (i.e. should be set via NUXT_AUTH_SECRET) in production.");
|
|
74
|
+
}
|
|
72
75
|
this.providerCookieOpts = {
|
|
73
76
|
secure: this.rc.public.auth.isSecure,
|
|
74
77
|
...this.rc.public.auth.providerCookieOpts
|