nuxt-auth-utils 0.5.20 → 0.5.21
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 +3 -0
- package/dist/module.json +1 -1
- package/dist/runtime/server/lib/oauth/azureb2c.js +1 -1
- package/dist/runtime/server/lib/oauth/heroku.js +1 -1
- package/dist/runtime/server/lib/oauth/keycloak.js +1 -1
- package/dist/runtime/server/lib/oauth/salesforce.js +1 -1
- package/dist/runtime/server/lib/oauth/slack.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -156,6 +156,9 @@ const session = await requireUserSession(event)
|
|
|
156
156
|
|
|
157
157
|
You can define the type for your user session by creating a type declaration file (for example, `auth.d.ts`) in your project to augment the `UserSession` type:
|
|
158
158
|
|
|
159
|
+
> [!NOTE]
|
|
160
|
+
> If you are using Nuxt >=4.0.0 or compatibility version 4 add the `auth.d.ts` file to the `shared` directory to get the correct types in server and client.
|
|
161
|
+
|
|
159
162
|
```ts
|
|
160
163
|
// auth.d.ts
|
|
161
164
|
declare module '#auth-utils' {
|
package/dist/module.json
CHANGED
|
@@ -35,7 +35,7 @@ export function defineOAuthAzureB2CEventHandler({ config, onSuccess, onError })
|
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
37
|
if (query.state !== state) {
|
|
38
|
-
handleInvalidState(event, "azureb2c", onError);
|
|
38
|
+
return handleInvalidState(event, "azureb2c", onError);
|
|
39
39
|
}
|
|
40
40
|
console.info("code verifier", verifier.code_verifier);
|
|
41
41
|
const tokens = await requestAccessToken(tokenURL, {
|
|
@@ -46,7 +46,7 @@ export function defineOAuthHerokuEventHandler({
|
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
48
|
if (query.state !== state) {
|
|
49
|
-
handleInvalidState(event, "heroku", onError);
|
|
49
|
+
return handleInvalidState(event, "heroku", onError);
|
|
50
50
|
}
|
|
51
51
|
const tokens = await requestAccessToken(config.tokenURL, {
|
|
52
52
|
body: {
|
|
@@ -62,7 +62,7 @@ export function defineOAuthKeycloakEventHandler({
|
|
|
62
62
|
}
|
|
63
63
|
const accessToken = tokens.access_token;
|
|
64
64
|
const user = await $fetch(
|
|
65
|
-
`${
|
|
65
|
+
`${realmURLInternal}/protocol/openid-connect/userinfo`,
|
|
66
66
|
{
|
|
67
67
|
headers: {
|
|
68
68
|
Authorization: `Bearer ${accessToken}`,
|
|
@@ -46,7 +46,7 @@ export function defineOAuthSalesforceEventHandler({
|
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
48
|
if (query.state !== state) {
|
|
49
|
-
handleInvalidState(event, "salesforce", onError);
|
|
49
|
+
return handleInvalidState(event, "salesforce", onError);
|
|
50
50
|
}
|
|
51
51
|
const tokens = await requestAccessToken(config.tokenURL, {
|
|
52
52
|
body: {
|
|
@@ -46,7 +46,7 @@ export function defineOAuthSlackEventHandler({
|
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
48
|
if (query.state !== state) {
|
|
49
|
-
handleInvalidState(event, "slack", onError);
|
|
49
|
+
return handleInvalidState(event, "slack", onError);
|
|
50
50
|
}
|
|
51
51
|
const tokens = await requestAccessToken(config.tokenURL, {
|
|
52
52
|
body: {
|