nuxt-auth-utils 0.5.13 → 0.5.15
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/README.md +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -21
- package/dist/runtime/app/plugins/session.client.js +1 -1
- package/dist/runtime/server/routes/atproto/client-metadata.json.get.js +1 -1
- package/dist/runtime/server/utils/atproto.d.ts +1 -1
- package/dist/runtime/server/utils/atproto.js +1 -1
- package/dist/runtime/utils/atproto.d.ts +5 -0
- package/dist/runtime/utils/atproto.js +19 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -393,7 +393,7 @@ export default defineWebAuthnRegisterEventHandler({
|
|
|
393
393
|
// We first check if the user is already authenticated by getting the session
|
|
394
394
|
// And verify that the email is the same as the one in session
|
|
395
395
|
const session = await getUserSession(event)
|
|
396
|
-
if (session.user?.email && session.user.email !==
|
|
396
|
+
if (session.user?.email && session.user.email !== userBody.userName) {
|
|
397
397
|
throw createError({ statusCode: 400, message: 'Email not matching curent session' })
|
|
398
398
|
}
|
|
399
399
|
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -3,26 +3,7 @@ import { defineNuxtModule, createResolver, addComponentsDir, addImports, addPlug
|
|
|
3
3
|
import { join } from 'pathe';
|
|
4
4
|
import { defu } from 'defu';
|
|
5
5
|
import { randomUUID } from 'uncrypto';
|
|
6
|
-
|
|
7
|
-
const atprotoProviders = ["bluesky"];
|
|
8
|
-
const atprotoProviderDefaultClientMetadata = {
|
|
9
|
-
clientMetadataFilename: "",
|
|
10
|
-
clientName: "",
|
|
11
|
-
clientUri: "",
|
|
12
|
-
logoUri: "",
|
|
13
|
-
policyUri: "",
|
|
14
|
-
tosUri: "",
|
|
15
|
-
scope: ["atproto"],
|
|
16
|
-
grantTypes: ["authorization_code"],
|
|
17
|
-
responseTypes: ["code"],
|
|
18
|
-
applicationType: "web",
|
|
19
|
-
redirectUris: [],
|
|
20
|
-
dpopBoundAccessTokens: true,
|
|
21
|
-
tokenEndpointAuthMethod: "none"
|
|
22
|
-
};
|
|
23
|
-
function getClientMetadataFilename(provider, config) {
|
|
24
|
-
return config?.clientMetadataFilename || provider + "/client-metadata.json";
|
|
25
|
-
}
|
|
6
|
+
import { atprotoProviders, atprotoProviderDefaultClientMetadata, getClientMetadataFilename } from '../dist/runtime/utils/atproto.js';
|
|
26
7
|
|
|
27
8
|
const module = defineNuxtModule({
|
|
28
9
|
meta: {
|
|
@@ -203,7 +184,7 @@ const module = defineNuxtModule({
|
|
|
203
184
|
}
|
|
204
185
|
for (const provider of atprotoProviders) {
|
|
205
186
|
addServerHandler({
|
|
206
|
-
handler: resolver.resolve("./runtime/server/routes/atproto/client-metadata.json.get
|
|
187
|
+
handler: resolver.resolve("./runtime/server/routes/atproto/client-metadata.json.get"),
|
|
207
188
|
route: "/" + getClientMetadataFilename(provider, runtimeConfig.oauth[provider]),
|
|
208
189
|
method: "get"
|
|
209
190
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineEventHandler, createError } from "h3";
|
|
2
2
|
import { getAtprotoClientMetadata } from "../../utils/atproto.js";
|
|
3
|
-
import { atprotoProviders, getClientMetadataFilename } from "
|
|
3
|
+
import { atprotoProviders, getClientMetadataFilename } from "../../../utils/atproto.js";
|
|
4
4
|
import { useRuntimeConfig } from "#imports";
|
|
5
5
|
export default defineEventHandler((event) => {
|
|
6
6
|
const path = event.path.slice(1);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { H3Event } from 'h3';
|
|
2
2
|
import type { OAuthClientMetadataInput } from '@atproto/oauth-client-node';
|
|
3
|
-
import type { OAuthBlueskyConfig } from '../lib/
|
|
3
|
+
import type { OAuthBlueskyConfig } from '../lib/atproto/bluesky.js';
|
|
4
4
|
import type { ATProtoProvider, OAuthConfig } from '#auth-utils';
|
|
5
5
|
export declare function getAtprotoClientMetadata(event: H3Event, provider: ATProtoProvider, config?: OAuthConfig<OAuthBlueskyConfig>['config']): OAuthClientMetadataInput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getOAuthRedirectURL } from "../lib/utils.js";
|
|
2
|
-
import { getClientMetadataFilename } from "
|
|
2
|
+
import { getClientMetadataFilename } from "../../utils/atproto.js";
|
|
3
3
|
import { getRequestURL, useRuntimeConfig } from "#imports";
|
|
4
4
|
export function getAtprotoClientMetadata(event, provider, config) {
|
|
5
5
|
const providerRuntimeConfig = useRuntimeConfig(event).oauth[provider];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { OAuthProvider } from '../types/index.js';
|
|
2
|
+
import type { AtprotoProviderClientMetadata } from '../types/atproto.js';
|
|
3
|
+
export declare const atprotoProviders: "bluesky"[];
|
|
4
|
+
export declare const atprotoProviderDefaultClientMetadata: AtprotoProviderClientMetadata;
|
|
5
|
+
export declare function getClientMetadataFilename(provider: OAuthProvider, config?: AtprotoProviderClientMetadata): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const atprotoProviders = ["bluesky"];
|
|
2
|
+
export const atprotoProviderDefaultClientMetadata = {
|
|
3
|
+
clientMetadataFilename: "",
|
|
4
|
+
clientName: "",
|
|
5
|
+
clientUri: "",
|
|
6
|
+
logoUri: "",
|
|
7
|
+
policyUri: "",
|
|
8
|
+
tosUri: "",
|
|
9
|
+
scope: ["atproto"],
|
|
10
|
+
grantTypes: ["authorization_code"],
|
|
11
|
+
responseTypes: ["code"],
|
|
12
|
+
applicationType: "web",
|
|
13
|
+
redirectUris: [],
|
|
14
|
+
dpopBoundAccessTokens: true,
|
|
15
|
+
tokenEndpointAuthMethod: "none"
|
|
16
|
+
};
|
|
17
|
+
export function getClientMetadataFilename(provider, config) {
|
|
18
|
+
return config?.clientMetadataFilename || provider + "/client-metadata.json";
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-auth-utils",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.15",
|
|
4
4
|
"description": "Add Authentication to Nuxt applications with secured & sealed cookies sessions.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@nuxt/test-utils": "^3.15.4",
|
|
78
78
|
"@nuxt/ui": "^2.21.0",
|
|
79
79
|
"@nuxt/ui-pro": "^1.7.0",
|
|
80
|
-
"@simplewebauthn/types": "^
|
|
80
|
+
"@simplewebauthn/types": "^11.0.0",
|
|
81
81
|
"changelogen": "^0.5.7",
|
|
82
82
|
"eslint": "^9.19.0",
|
|
83
83
|
"nuxt": "^3.15.4",
|