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 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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "auth-utils",
3
3
  "configKey": "auth",
4
- "version": "0.5.20",
4
+ "version": "0.5.21",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
@@ -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
- `${realmURL}/protocol/openid-connect/userinfo`,
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: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-auth-utils",
3
- "version": "0.5.20",
3
+ "version": "0.5.21",
4
4
  "description": "Add Authentication to Nuxt applications with secured & sealed cookies sessions.",
5
5
  "repository": {
6
6
  "type": "git",