nuxt-auth-utils 0.5.31 → 0.5.32

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.
Files changed (103) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/server/api/session.delete.d.ts +1 -3
  3. package/dist/runtime/server/api/session.get.d.ts +1 -1
  4. package/dist/runtime/server/lib/atproto/bluesky.d.ts +1 -1
  5. package/dist/runtime/server/lib/oauth/apple.d.ts +1 -1
  6. package/dist/runtime/server/lib/oauth/apple.js +1 -1
  7. package/dist/runtime/server/lib/oauth/atlassian.d.ts +1 -1
  8. package/dist/runtime/server/lib/oauth/atlassian.js +1 -1
  9. package/dist/runtime/server/lib/oauth/auth0.d.ts +1 -1
  10. package/dist/runtime/server/lib/oauth/auth0.js +1 -1
  11. package/dist/runtime/server/lib/oauth/authentik.d.ts +1 -1
  12. package/dist/runtime/server/lib/oauth/authentik.js +1 -1
  13. package/dist/runtime/server/lib/oauth/azureb2c.d.ts +1 -1
  14. package/dist/runtime/server/lib/oauth/azureb2c.js +1 -1
  15. package/dist/runtime/server/lib/oauth/battledotnet.d.ts +1 -1
  16. package/dist/runtime/server/lib/oauth/battledotnet.js +1 -1
  17. package/dist/runtime/server/lib/oauth/box.d.ts +1 -1
  18. package/dist/runtime/server/lib/oauth/box.js +1 -1
  19. package/dist/runtime/server/lib/oauth/cognito.d.ts +1 -1
  20. package/dist/runtime/server/lib/oauth/cognito.js +1 -1
  21. package/dist/runtime/server/lib/oauth/discord.d.ts +1 -1
  22. package/dist/runtime/server/lib/oauth/discord.js +1 -1
  23. package/dist/runtime/server/lib/oauth/dropbox.d.ts +1 -1
  24. package/dist/runtime/server/lib/oauth/dropbox.js +1 -1
  25. package/dist/runtime/server/lib/oauth/facebook.d.ts +1 -1
  26. package/dist/runtime/server/lib/oauth/facebook.js +1 -1
  27. package/dist/runtime/server/lib/oauth/gitea.d.ts +1 -1
  28. package/dist/runtime/server/lib/oauth/gitea.js +1 -1
  29. package/dist/runtime/server/lib/oauth/github.d.ts +1 -1
  30. package/dist/runtime/server/lib/oauth/github.js +1 -1
  31. package/dist/runtime/server/lib/oauth/gitlab.d.ts +1 -1
  32. package/dist/runtime/server/lib/oauth/gitlab.js +1 -1
  33. package/dist/runtime/server/lib/oauth/google.d.ts +1 -1
  34. package/dist/runtime/server/lib/oauth/google.js +1 -1
  35. package/dist/runtime/server/lib/oauth/heroku.d.ts +1 -1
  36. package/dist/runtime/server/lib/oauth/heroku.js +1 -1
  37. package/dist/runtime/server/lib/oauth/hubspot.d.ts +1 -1
  38. package/dist/runtime/server/lib/oauth/hubspot.js +1 -1
  39. package/dist/runtime/server/lib/oauth/instagram.d.ts +1 -1
  40. package/dist/runtime/server/lib/oauth/instagram.js +1 -1
  41. package/dist/runtime/server/lib/oauth/keycloak.d.ts +1 -1
  42. package/dist/runtime/server/lib/oauth/keycloak.js +1 -1
  43. package/dist/runtime/server/lib/oauth/kick.d.ts +1 -1
  44. package/dist/runtime/server/lib/oauth/kick.js +1 -1
  45. package/dist/runtime/server/lib/oauth/line.d.ts +1 -1
  46. package/dist/runtime/server/lib/oauth/line.js +1 -1
  47. package/dist/runtime/server/lib/oauth/linear.d.ts +1 -1
  48. package/dist/runtime/server/lib/oauth/linear.js +1 -1
  49. package/dist/runtime/server/lib/oauth/linkedin.d.ts +1 -1
  50. package/dist/runtime/server/lib/oauth/linkedin.js +1 -1
  51. package/dist/runtime/server/lib/oauth/livechat.d.ts +1 -1
  52. package/dist/runtime/server/lib/oauth/livechat.js +1 -1
  53. package/dist/runtime/server/lib/oauth/microsoft.d.ts +1 -1
  54. package/dist/runtime/server/lib/oauth/microsoft.js +1 -1
  55. package/dist/runtime/server/lib/oauth/oidc.d.ts +1 -1
  56. package/dist/runtime/server/lib/oauth/oidc.js +1 -1
  57. package/dist/runtime/server/lib/oauth/okta.d.ts +1 -1
  58. package/dist/runtime/server/lib/oauth/okta.js +1 -1
  59. package/dist/runtime/server/lib/oauth/ory.d.ts +1 -1
  60. package/dist/runtime/server/lib/oauth/ory.js +1 -1
  61. package/dist/runtime/server/lib/oauth/osu.d.ts +1 -1
  62. package/dist/runtime/server/lib/oauth/osu.js +1 -1
  63. package/dist/runtime/server/lib/oauth/paypal.d.ts +1 -1
  64. package/dist/runtime/server/lib/oauth/paypal.js +1 -1
  65. package/dist/runtime/server/lib/oauth/polar.d.ts +1 -1
  66. package/dist/runtime/server/lib/oauth/polar.js +1 -1
  67. package/dist/runtime/server/lib/oauth/riotgames.d.ts +1 -1
  68. package/dist/runtime/server/lib/oauth/riotgames.js +1 -1
  69. package/dist/runtime/server/lib/oauth/roblox.d.ts +1 -1
  70. package/dist/runtime/server/lib/oauth/roblox.js +1 -1
  71. package/dist/runtime/server/lib/oauth/salesforce.d.ts +1 -1
  72. package/dist/runtime/server/lib/oauth/salesforce.js +1 -1
  73. package/dist/runtime/server/lib/oauth/seznam.d.ts +1 -1
  74. package/dist/runtime/server/lib/oauth/seznam.js +1 -1
  75. package/dist/runtime/server/lib/oauth/shopifyCustomer.d.ts +1 -1
  76. package/dist/runtime/server/lib/oauth/shopifyCustomer.js +1 -1
  77. package/dist/runtime/server/lib/oauth/slack.d.ts +1 -1
  78. package/dist/runtime/server/lib/oauth/slack.js +1 -1
  79. package/dist/runtime/server/lib/oauth/spotify.d.ts +1 -1
  80. package/dist/runtime/server/lib/oauth/spotify.js +1 -1
  81. package/dist/runtime/server/lib/oauth/steam.d.ts +1 -1
  82. package/dist/runtime/server/lib/oauth/steam.js +1 -1
  83. package/dist/runtime/server/lib/oauth/strava.d.ts +1 -1
  84. package/dist/runtime/server/lib/oauth/strava.js +1 -1
  85. package/dist/runtime/server/lib/oauth/tiktok.d.ts +1 -1
  86. package/dist/runtime/server/lib/oauth/tiktok.js +1 -1
  87. package/dist/runtime/server/lib/oauth/twitch.d.ts +1 -1
  88. package/dist/runtime/server/lib/oauth/twitch.js +1 -1
  89. package/dist/runtime/server/lib/oauth/vk.d.ts +1 -1
  90. package/dist/runtime/server/lib/oauth/vk.js +1 -1
  91. package/dist/runtime/server/lib/oauth/workos.d.ts +1 -1
  92. package/dist/runtime/server/lib/oauth/workos.js +1 -1
  93. package/dist/runtime/server/lib/oauth/x.d.ts +1 -1
  94. package/dist/runtime/server/lib/oauth/x.js +1 -1
  95. package/dist/runtime/server/lib/oauth/xsuaa.d.ts +1 -1
  96. package/dist/runtime/server/lib/oauth/xsuaa.js +1 -1
  97. package/dist/runtime/server/lib/oauth/yandex.d.ts +1 -1
  98. package/dist/runtime/server/lib/oauth/yandex.js +1 -1
  99. package/dist/runtime/server/lib/oauth/zitadel.d.ts +1 -1
  100. package/dist/runtime/server/lib/oauth/zitadel.js +1 -1
  101. package/dist/runtime/server/lib/utils.d.ts +3 -3
  102. package/dist/runtime/server/routes/atproto/client-metadata.json.get.d.ts +1 -128
  103. package/package.json +1 -1
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "auth-utils",
3
3
  "configKey": "auth",
4
- "version": "0.5.31",
4
+ "version": "0.5.32",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -1,4 +1,2 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<{
2
- loggedOut: boolean;
3
- }>>;
1
+ declare const _default: any;
4
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<UserSession>>;
1
+ declare const _default: any;
2
2
  export default _default;
@@ -22,7 +22,7 @@ type BlueSkyTokens = NodeSavedSession['tokenSet'];
22
22
  export declare function defineOAuthBlueskyEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthBlueskyConfig, {
23
23
  user: BlueSkyUser;
24
24
  tokens: BlueSkyTokens;
25
- }>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
25
+ }>): any;
26
26
  export declare class StateStore implements NodeSavedStateStore {
27
27
  private event;
28
28
  private readonly stateKey;
@@ -74,4 +74,4 @@ export declare function defineOAuthAppleEventHandler({ config, onSuccess, onErro
74
74
  user: OAuthAppleUser;
75
75
  payload: OAuthAppleTokens;
76
76
  tokens: any;
77
- }>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
77
+ }>): any;
@@ -44,7 +44,7 @@ export function defineOAuthAppleEventHandler({
44
44
  })
45
45
  );
46
46
  }
47
- if (state !== storedState) {
47
+ if (!storedState || state !== storedState) {
48
48
  return handleInvalidState(event, "apple", onError);
49
49
  }
50
50
  try {
@@ -91,5 +91,5 @@ export interface OAuthAtlassianConfig {
91
91
  export declare function defineOAuthAtlassianEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthAtlassianConfig, {
92
92
  user: AtlassianUser;
93
93
  tokens: AtlassianTokens;
94
- }>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
94
+ }>): any;
95
95
  export {};
@@ -52,7 +52,7 @@ export function defineOAuthAtlassianEventHandler({
52
52
  if (!onError) throw error;
53
53
  return onError(event, error);
54
54
  }
55
- if (query.state !== state) {
55
+ if (!state || query.state !== state) {
56
56
  return handleInvalidState(event, "atlassian", onError);
57
57
  }
58
58
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -57,4 +57,4 @@ export interface OAuthAuth0Config {
57
57
  */
58
58
  redirectURL?: string;
59
59
  }
60
- export declare function defineOAuthAuth0EventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthAuth0Config>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
60
+ export declare function defineOAuthAuth0EventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthAuth0Config>): any;
@@ -47,7 +47,7 @@ export function defineOAuthAuth0EventHandler({ config, onSuccess, onError }) {
47
47
  })
48
48
  );
49
49
  }
50
- if (query.state !== state) {
50
+ if (!state || query.state !== state) {
51
51
  return handleInvalidState(event, "auth0", onError);
52
52
  }
53
53
  const tokens = await requestAccessToken(tokenURL, {
@@ -27,4 +27,4 @@ export interface OAuthAuthentikConfig {
27
27
  */
28
28
  scope?: string[];
29
29
  }
30
- export declare function defineOAuthAuthentikEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthAuthentikConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
30
+ export declare function defineOAuthAuthentikEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthAuthentikConfig>): any;
@@ -35,7 +35,7 @@ export function defineOAuthAuthentikEventHandler({ config, onSuccess, onError })
35
35
  })
36
36
  );
37
37
  }
38
- if (query.state !== state) {
38
+ if (!state || query.state !== state) {
39
39
  return handleInvalidState(event, "authentik", onError);
40
40
  }
41
41
  const tokens = await requestAccessToken(tokenURL, {
@@ -51,4 +51,4 @@ export interface OAuthAzureB2CConfig {
51
51
  */
52
52
  redirectURL?: string;
53
53
  }
54
- export declare function defineOAuthAzureB2CEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthAzureB2CConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
54
+ export declare function defineOAuthAzureB2CEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthAzureB2CConfig>): any;
@@ -34,7 +34,7 @@ export function defineOAuthAzureB2CEventHandler({ config, onSuccess, onError })
34
34
  })
35
35
  );
36
36
  }
37
- if (query.state !== state) {
37
+ if (!state || query.state !== state) {
38
38
  return handleInvalidState(event, "azureb2c", onError);
39
39
  }
40
40
  const tokens = await requestAccessToken(tokenURL, {
@@ -45,4 +45,4 @@ export interface OAuthBattledotnetConfig {
45
45
  */
46
46
  redirectURL?: string;
47
47
  }
48
- export declare function defineOAuthBattledotnetEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthBattledotnetConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
48
+ export declare function defineOAuthBattledotnetEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthBattledotnetConfig>): any;
@@ -49,7 +49,7 @@ export function defineOAuthBattledotnetEventHandler({ config, onSuccess, onError
49
49
  })
50
50
  );
51
51
  }
52
- if (query.state !== state) {
52
+ if (!state || query.state !== state) {
53
53
  return handleInvalidState(event, "battledotnet", onError);
54
54
  }
55
55
  config.scope = config.scope || [];
@@ -91,5 +91,5 @@ interface OAuthBoxTokens {
91
91
  export declare function defineOAuthBoxEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthBoxConfig, {
92
92
  user: OAuthBoxUser;
93
93
  tokens: OAuthBoxTokens;
94
- }>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
94
+ }>): any;
95
95
  export {};
@@ -41,7 +41,7 @@ export function defineOAuthBoxEventHandler({ config, onSuccess, onError }) {
41
41
  })
42
42
  );
43
43
  }
44
- if (query.state !== state) {
44
+ if (!state || query.state !== state) {
45
45
  return handleInvalidState(event, "box", onError);
46
46
  }
47
47
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -36,4 +36,4 @@ export interface OAuthCognitoConfig {
36
36
  */
37
37
  redirectURL?: string;
38
38
  }
39
- export declare function defineOAuthCognitoEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthCognitoConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
39
+ export declare function defineOAuthCognitoEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthCognitoConfig>): any;
@@ -39,7 +39,7 @@ export function defineOAuthCognitoEventHandler({ config, onSuccess, onError }) {
39
39
  })
40
40
  );
41
41
  }
42
- if (query.state !== state) {
42
+ if (!state || query.state !== state) {
43
43
  return handleInvalidState(event, "cognito", onError);
44
44
  }
45
45
  const tokens = await requestAccessToken(
@@ -50,4 +50,4 @@ export interface OAuthDiscordConfig {
50
50
  */
51
51
  redirectURL?: string;
52
52
  }
53
- export declare function defineOAuthDiscordEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthDiscordConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
53
+ export declare function defineOAuthDiscordEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthDiscordConfig>): any;
@@ -40,7 +40,7 @@ export function defineOAuthDiscordEventHandler({ config, onSuccess, onError }) {
40
40
  })
41
41
  );
42
42
  }
43
- if (query.state !== state) {
43
+ if (!state || query.state !== state) {
44
44
  return handleInvalidState(event, "discord", onError);
45
45
  }
46
46
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -44,4 +44,4 @@ export interface OAuthDropboxConfig {
44
44
  */
45
45
  redirectURL?: string;
46
46
  }
47
- export declare function defineOAuthDropboxEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthDropboxConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
47
+ export declare function defineOAuthDropboxEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthDropboxConfig>): any;
@@ -36,7 +36,7 @@ export function defineOAuthDropboxEventHandler({ config, onSuccess, onError }) {
36
36
  })
37
37
  );
38
38
  }
39
- if (query.state !== state) {
39
+ if (!state || query.state !== state) {
40
40
  return handleInvalidState(event, "dropbox", onError);
41
41
  }
42
42
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -45,4 +45,4 @@ export interface OAuthFacebookConfig {
45
45
  */
46
46
  redirectURL?: string;
47
47
  }
48
- export declare function defineOAuthFacebookEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthFacebookConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
48
+ export declare function defineOAuthFacebookEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthFacebookConfig>): any;
@@ -42,7 +42,7 @@ export function defineOAuthFacebookEventHandler({
42
42
  })
43
43
  );
44
44
  }
45
- if (query.state !== state) {
45
+ if (!state || query.state !== state) {
46
46
  return handleInvalidState(event, "facebook", onError);
47
47
  }
48
48
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -48,4 +48,4 @@ export interface OAuthGiteaConfig {
48
48
  */
49
49
  baseURL?: string;
50
50
  }
51
- export declare function defineOAuthGiteaEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthGiteaConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
51
+ export declare function defineOAuthGiteaEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthGiteaConfig>): any;
@@ -63,7 +63,7 @@ export function defineOAuthGiteaEventHandler({
63
63
  })
64
64
  );
65
65
  }
66
- if (query.state !== state) {
66
+ if (!state || query.state !== state) {
67
67
  return handleInvalidState(event, "gitea", onError);
68
68
  }
69
69
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -93,5 +93,5 @@ interface GitHubTokens {
93
93
  export declare function defineOAuthGitHubEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthGitHubConfig, {
94
94
  user: GitHubUser;
95
95
  tokens: GitHubTokens;
96
- }>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
96
+ }>): any;
97
97
  export {};
@@ -42,7 +42,7 @@ export function defineOAuthGitHubEventHandler({ config, onSuccess, onError }) {
42
42
  })
43
43
  );
44
44
  }
45
- if (query.state !== state) {
45
+ if (!state || query.state !== state) {
46
46
  return handleInvalidState(event, "github", onError);
47
47
  }
48
48
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -49,4 +49,4 @@ export interface OAuthGitLabConfig {
49
49
  */
50
50
  baseURL?: string;
51
51
  }
52
- export declare function defineOAuthGitLabEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthGitLabConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
52
+ export declare function defineOAuthGitLabEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthGitLabConfig>): any;
@@ -63,7 +63,7 @@ export function defineOAuthGitLabEventHandler({
63
63
  })
64
64
  );
65
65
  }
66
- if (query.state !== state) {
66
+ if (!state || query.state !== state) {
67
67
  return handleInvalidState(event, "gitlab", onError);
68
68
  }
69
69
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -44,4 +44,4 @@ export interface OAuthGoogleConfig {
44
44
  */
45
45
  redirectURL?: string;
46
46
  }
47
- export declare function defineOAuthGoogleEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthGoogleConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
47
+ export declare function defineOAuthGoogleEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthGoogleConfig>): any;
@@ -35,7 +35,7 @@ export function defineOAuthGoogleEventHandler({
35
35
  })
36
36
  );
37
37
  }
38
- if (query.state !== state) {
38
+ if (!state || query.state !== state) {
39
39
  return handleInvalidState(event, "google", onError);
40
40
  }
41
41
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -38,4 +38,4 @@ export interface OAuthHerokuConfig {
38
38
  */
39
39
  redirectURL?: string;
40
40
  }
41
- export declare function defineOAuthHerokuEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthHerokuConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
41
+ export declare function defineOAuthHerokuEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthHerokuConfig>): any;
@@ -45,7 +45,7 @@ export function defineOAuthHerokuEventHandler({
45
45
  })
46
46
  );
47
47
  }
48
- if (query.state !== state) {
48
+ if (!state || query.state !== state) {
49
49
  return handleInvalidState(event, "heroku", onError);
50
50
  }
51
51
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -23,4 +23,4 @@ export interface OAuthHubspotConfig {
23
23
  */
24
24
  scope?: string[];
25
25
  }
26
- export declare function defineOAuthHubspotEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthHubspotConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
26
+ export declare function defineOAuthHubspotEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthHubspotConfig>): any;
@@ -33,7 +33,7 @@ export function defineOAuthHubspotEventHandler({ config, onSuccess, onError }) {
33
33
  })
34
34
  );
35
35
  }
36
- if (query.state !== state) {
36
+ if (!state || query.state !== state) {
37
37
  return handleInvalidState(event, "hubspot", onError);
38
38
  }
39
39
  const tokens = await requestAccessToken(
@@ -45,4 +45,4 @@ export interface OAuthInstagramConfig {
45
45
  */
46
46
  redirectURL?: string;
47
47
  }
48
- export declare function defineOAuthInstagramEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthInstagramConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
48
+ export declare function defineOAuthInstagramEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthInstagramConfig>): any;
@@ -47,7 +47,7 @@ export function defineOAuthInstagramEventHandler({
47
47
  })
48
48
  );
49
49
  }
50
- if (query.state !== state) {
50
+ if (!state || query.state !== state) {
51
51
  return handleInvalidState(event, "instagram", onError);
52
52
  }
53
53
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -45,4 +45,4 @@ export interface OAuthKeycloakConfig {
45
45
  */
46
46
  redirectURL?: string;
47
47
  }
48
- export declare function defineOAuthKeycloakEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthKeycloakConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
48
+ export declare function defineOAuthKeycloakEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthKeycloakConfig>): any;
@@ -46,7 +46,7 @@ export function defineOAuthKeycloakEventHandler({
46
46
  })
47
47
  );
48
48
  }
49
- if (query.state !== state) {
49
+ if (!state || query.state !== state) {
50
50
  return handleInvalidState(event, "keycloak", onError);
51
51
  }
52
52
  config.scope = config.scope || [];
@@ -51,5 +51,5 @@ interface KickTokens {
51
51
  export declare function defineOAuthKickEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthKickConfig, {
52
52
  user: KickUser;
53
53
  tokens: KickTokens;
54
- }>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
54
+ }>): any;
55
55
  export {};
@@ -33,7 +33,7 @@ export function defineOAuthKickEventHandler({ config, onSuccess, onError }) {
33
33
  })
34
34
  );
35
35
  }
36
- if (query.state !== state) {
36
+ if (!state || query.state !== state) {
37
37
  return handleInvalidState(event, "kick", onError);
38
38
  }
39
39
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -42,4 +42,4 @@ export interface OAuthLineConfig {
42
42
  */
43
43
  redirectURL?: string;
44
44
  }
45
- export declare function defineOAuthLineEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthLineConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
45
+ export declare function defineOAuthLineEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthLineConfig>): any;
@@ -44,7 +44,7 @@ export function defineOAuthLineEventHandler({
44
44
  })
45
45
  );
46
46
  }
47
- if (query.state !== state) {
47
+ if (!state || query.state !== state) {
48
48
  return handleInvalidState(event, "line", onError);
49
49
  }
50
50
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -38,4 +38,4 @@ export interface OAuthLinearConfig {
38
38
  */
39
39
  redirectURL?: string;
40
40
  }
41
- export declare function defineOAuthLinearEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthLinearConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
41
+ export declare function defineOAuthLinearEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthLinearConfig>): any;
@@ -39,7 +39,7 @@ export function defineOAuthLinearEventHandler({ config, onSuccess, onError }) {
39
39
  })
40
40
  );
41
41
  }
42
- if (query.state !== state) {
42
+ if (!state || query.state !== state) {
43
43
  return handleInvalidState(event, "linear", onError);
44
44
  }
45
45
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -42,4 +42,4 @@ export interface OAuthLinkedInConfig {
42
42
  */
43
43
  redirectURL?: string;
44
44
  }
45
- export declare function defineOAuthLinkedInEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthLinkedInConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
45
+ export declare function defineOAuthLinkedInEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthLinkedInConfig>): any;
@@ -36,7 +36,7 @@ export function defineOAuthLinkedInEventHandler({ config, onSuccess, onError })
36
36
  })
37
37
  );
38
38
  }
39
- if (query.state !== state) {
39
+ if (!state || query.state !== state) {
40
40
  return handleInvalidState(event, "linkedin", onError);
41
41
  }
42
42
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -70,4 +70,4 @@ export interface LiveChatConfig {
70
70
  */
71
71
  authorizationParams?: Record<string, string>;
72
72
  }
73
- export declare function defineOAuthLiveChatEventHandler({ config, onSuccess, onError, }: OAuthConfig<LiveChatConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
73
+ export declare function defineOAuthLiveChatEventHandler({ config, onSuccess, onError, }: OAuthConfig<LiveChatConfig>): any;
@@ -46,7 +46,7 @@ export function defineOAuthLiveChatEventHandler({
46
46
  })
47
47
  );
48
48
  }
49
- if (query.state !== state) {
49
+ if (!state || query.state !== state) {
50
50
  return handleInvalidState(event, "livechat", onError);
51
51
  }
52
52
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -51,4 +51,4 @@ export interface OAuthMicrosoftConfig {
51
51
  */
52
52
  redirectURL?: string;
53
53
  }
54
- export declare function defineOAuthMicrosoftEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthMicrosoftConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
54
+ export declare function defineOAuthMicrosoftEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthMicrosoftConfig>): any;
@@ -31,7 +31,7 @@ export function defineOAuthMicrosoftEventHandler({ config, onSuccess, onError })
31
31
  })
32
32
  );
33
33
  }
34
- if (query.state !== state) {
34
+ if (!state || query.state !== state) {
35
35
  return handleInvalidState(event, "microsoft", onError);
36
36
  }
37
37
  const tokens = await requestAccessToken(tokenURL, {
@@ -211,5 +211,5 @@ interface OIDCConfiguration {
211
211
  export declare function defineOAuthOidcEventHandler<TUser = OidcUser>({ config, onSuccess, onError }: OAuthConfig<OAuthOidcConfig, {
212
212
  user: TUser;
213
213
  tokens: OidcTokens;
214
- }>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
214
+ }>): any;
215
215
  export {};
@@ -44,7 +44,7 @@ export function defineOAuthOidcEventHandler({ config, onSuccess, onError }) {
44
44
  withQuery(oidcConfig.authorization_endpoint, authQuery)
45
45
  );
46
46
  }
47
- if (query.state !== state) {
47
+ if (!state || query.state !== state) {
48
48
  return handleInvalidState(event, "oidc", onError);
49
49
  }
50
50
  const tokenQuery = {
@@ -85,4 +85,4 @@ export interface OAuthOktaConfig {
85
85
  */
86
86
  openIdConfigCacheTTL?: number;
87
87
  }
88
- export declare function defineOAuthOktaEventHandler({ config, onSuccess, onError }: OAuthConfigExt<OAuthOktaConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
88
+ export declare function defineOAuthOktaEventHandler({ config, onSuccess, onError }: OAuthConfigExt<OAuthOktaConfig>): any;
@@ -113,7 +113,7 @@ export function defineOAuthOktaEventHandler({ config, onSuccess, onError }) {
113
113
  })
114
114
  );
115
115
  }
116
- if (query.state !== state) {
116
+ if (!state || query.state !== state) {
117
117
  return handleInvalidState(event, "okta", onError);
118
118
  }
119
119
  const tokens = await requestAccessToken(tokenURL, {
@@ -48,4 +48,4 @@ export interface OAuthOryConfig {
48
48
  */
49
49
  userURL?: string;
50
50
  }
51
- export declare function defineOAuthOryEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthOryConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
51
+ export declare function defineOAuthOryEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthOryConfig>): any;
@@ -56,7 +56,7 @@ export function defineOAuthOryEventHandler({ config, onSuccess, onError }) {
56
56
  })
57
57
  );
58
58
  }
59
- if (query.state !== state) {
59
+ if (!state || query.state !== state) {
60
60
  return handleInvalidState(event, "ory", onError);
61
61
  }
62
62
  const tokenURL = `${config.sdkURL}${config.tokenURL}`;
@@ -39,4 +39,4 @@ export interface OAuthOsuConfig {
39
39
  */
40
40
  redirectURL?: string;
41
41
  }
42
- export declare function defineOAuthOsuEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthOsuConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
42
+ export declare function defineOAuthOsuEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthOsuConfig>): any;
@@ -33,7 +33,7 @@ export function defineOAuthOsuEventHandler({ config, onSuccess, onError }) {
33
33
  })
34
34
  );
35
35
  }
36
- if (query.state !== state) {
36
+ if (!state || query.state !== state) {
37
37
  return handleInvalidState(event, "osu", onError);
38
38
  }
39
39
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -49,4 +49,4 @@ export interface OAuthPaypalConfig {
49
49
  */
50
50
  redirectURL?: string;
51
51
  }
52
- export declare function defineOAuthPaypalEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthPaypalConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
52
+ export declare function defineOAuthPaypalEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthPaypalConfig>): any;
@@ -44,7 +44,7 @@ export function defineOAuthPaypalEventHandler({ config, onSuccess, onError }) {
44
44
  })
45
45
  );
46
46
  }
47
- if (query.state !== state) {
47
+ if (!state || query.state !== state) {
48
48
  return handleInvalidState(event, "paypal", onError);
49
49
  }
50
50
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -46,4 +46,4 @@ export interface OAuthPolarConfig {
46
46
  */
47
47
  redirectURL?: string;
48
48
  }
49
- export declare function defineOAuthPolarEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthPolarConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
49
+ export declare function defineOAuthPolarEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthPolarConfig>): any;
@@ -33,7 +33,7 @@ export function defineOAuthPolarEventHandler({ config, onSuccess, onError }) {
33
33
  })
34
34
  );
35
35
  }
36
- if (query.state !== state) {
36
+ if (!state || query.state !== state) {
37
37
  return handleInvalidState(event, "polar", onError);
38
38
  }
39
39
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -70,5 +70,5 @@ interface RiotGamesTokens {
70
70
  export declare function defineOAuthRiotGamesEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthRiotGamesConfig, {
71
71
  user: RiotGamesUser;
72
72
  tokens: RiotGamesTokens;
73
- }>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
73
+ }>): any;
74
74
  export {};
@@ -43,7 +43,7 @@ export function defineOAuthRiotGamesEventHandler({ config, onSuccess, onError })
43
43
  })
44
44
  );
45
45
  }
46
- if (query.state !== state) {
46
+ if (!state || query.state !== state) {
47
47
  return handleInvalidState(event, "riotgames", onError);
48
48
  }
49
49
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -123,4 +123,4 @@ export interface OAuthRobloxUser {
123
123
  visibility: 'SOCIAL_NETWORK_VISIBILITY_UNSPECIFIED' | 'NO_ONE' | 'FRIENDS' | 'FRIENDS_AND_FOLLOWING' | 'FRIENDS_FOLLOWING_AND_FOLLOWERS' | 'EVERYONE';
124
124
  };
125
125
  }
126
- export declare function defineOAuthRobloxEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthRobloxConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
126
+ export declare function defineOAuthRobloxEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthRobloxConfig>): any;
@@ -33,7 +33,7 @@ export function defineOAuthRobloxEventHandler({ config, onSuccess, onError }) {
33
33
  })
34
34
  );
35
35
  }
36
- if (query.state !== state) {
36
+ if (!state || query.state !== state) {
37
37
  return handleInvalidState(event, "roblox", onError);
38
38
  }
39
39
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -43,4 +43,4 @@ export interface OAuthSalesforceConfig {
43
43
  */
44
44
  redirectURL?: string;
45
45
  }
46
- export declare function defineOAuthSalesforceEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthSalesforceConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
46
+ export declare function defineOAuthSalesforceEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthSalesforceConfig>): any;
@@ -45,7 +45,7 @@ export function defineOAuthSalesforceEventHandler({
45
45
  })
46
46
  );
47
47
  }
48
- if (query.state !== state) {
48
+ if (!state || query.state !== state) {
49
49
  return handleInvalidState(event, "salesforce", onError);
50
50
  }
51
51
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -95,4 +95,4 @@ export interface OAuthSeznamUser {
95
95
  export declare function defineOAuthSeznamEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthSeznamConfig, {
96
96
  user: OAuthSeznamUser;
97
97
  tokens: unknown;
98
- }>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
98
+ }>): any;
@@ -29,7 +29,7 @@ export function defineOAuthSeznamEventHandler({ config, onSuccess, onError }) {
29
29
  })
30
30
  );
31
31
  }
32
- if (query.state !== state) {
32
+ if (!state || query.state !== state) {
33
33
  return handleInvalidState(event, "seznam", onError);
34
34
  }
35
35
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -23,4 +23,4 @@ export interface OAuthShopifyCustomerConfig {
23
23
  */
24
24
  redirectURL?: string;
25
25
  }
26
- export declare function defineOAuthShopifyCustomerEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthShopifyCustomerConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
26
+ export declare function defineOAuthShopifyCustomerEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthShopifyCustomerConfig>): any;
@@ -42,7 +42,7 @@ export function defineOAuthShopifyCustomerEventHandler({
42
42
  })
43
43
  );
44
44
  }
45
- if (query.state !== state) {
45
+ if (!state || query.state !== state) {
46
46
  return handleInvalidState(event, "shopifyCustomer", onError);
47
47
  }
48
48
  const tokens = await requestAccessToken(discoveryResponse.token_endpoint, {
@@ -38,4 +38,4 @@ export interface OAuthSlackConfig {
38
38
  */
39
39
  redirectURL?: string;
40
40
  }
41
- export declare function defineOAuthSlackEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthSlackConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
41
+ export declare function defineOAuthSlackEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthSlackConfig>): any;
@@ -45,7 +45,7 @@ export function defineOAuthSlackEventHandler({
45
45
  })
46
46
  );
47
47
  }
48
- if (query.state !== state) {
48
+ if (!state || query.state !== state) {
49
49
  return handleInvalidState(event, "slack", onError);
50
50
  }
51
51
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -44,4 +44,4 @@ export interface OAuthSpotifyConfig {
44
44
  */
45
45
  redirectURL?: string;
46
46
  }
47
- export declare function defineOAuthSpotifyEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthSpotifyConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
47
+ export declare function defineOAuthSpotifyEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthSpotifyConfig>): any;
@@ -33,7 +33,7 @@ export function defineOAuthSpotifyEventHandler({ config, onSuccess, onError }) {
33
33
  })
34
34
  );
35
35
  }
36
- if (query.state !== state) {
36
+ if (!state || query.state !== state) {
37
37
  return handleInvalidState(event, "spotify", onError);
38
38
  }
39
39
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -17,4 +17,4 @@ export interface OAuthSteamConfig {
17
17
  */
18
18
  redirectURL?: string;
19
19
  }
20
- export declare function defineOAuthSteamEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthSteamConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
20
+ export declare function defineOAuthSteamEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthSteamConfig>): any;
@@ -27,7 +27,7 @@ export function defineOAuthSteamEventHandler({ config, onSuccess, onError }) {
27
27
  };
28
28
  return sendRedirect(event, withQuery(config.authorizationURL, steamOpenIdParams));
29
29
  }
30
- if (query.state !== state) {
30
+ if (!state || query.state !== state) {
31
31
  return handleInvalidState(event, "steam", onError);
32
32
  }
33
33
  if (!query["openid.signed"] || !query["openid.sig"]) {
@@ -116,4 +116,4 @@ export interface OAuthStravaTokens {
116
116
  export declare function defineOAuthStravaEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthStravaConfig, {
117
117
  user: OAuthStravaUser;
118
118
  tokens: OAuthStravaTokens;
119
- }>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
119
+ }>): any;
@@ -52,7 +52,7 @@ export function defineOAuthStravaEventHandler({
52
52
  })
53
53
  );
54
54
  }
55
- if (query.state !== state) {
55
+ if (!state || query.state !== state) {
56
56
  return handleInvalidState(event, "strava", onError);
57
57
  }
58
58
  const tokens = await requestAccessToken(tokenURL, {
@@ -42,4 +42,4 @@ export interface OAuthTikTokConfig {
42
42
  */
43
43
  redirectURL?: string;
44
44
  }
45
- export declare function defineOAuthTikTokEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthTikTokConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
45
+ export declare function defineOAuthTikTokEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthTikTokConfig>): any;
@@ -39,7 +39,7 @@ export function defineOAuthTikTokEventHandler({ config, onSuccess, onError }) {
39
39
  })
40
40
  );
41
41
  }
42
- if (query.state !== state) {
42
+ if (!state || query.state !== state) {
43
43
  return handleInvalidState(event, "tiktok", onError);
44
44
  }
45
45
  const tokens = await requestAccessToken(
@@ -67,5 +67,5 @@ interface TwitchTokens {
67
67
  export declare function defineOAuthTwitchEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthTwitchConfig, {
68
68
  user: TwitchUser;
69
69
  tokens: TwitchTokens;
70
- }>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
70
+ }>): any;
71
71
  export {};
@@ -33,7 +33,7 @@ export function defineOAuthTwitchEventHandler({ config, onSuccess, onError }) {
33
33
  })
34
34
  );
35
35
  }
36
- if (query.state !== state) {
36
+ if (!state || query.state !== state) {
37
37
  return handleInvalidState(event, "twitch", onError);
38
38
  }
39
39
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -43,4 +43,4 @@ export interface OAuthVKConfig {
43
43
  */
44
44
  redirectURL?: string;
45
45
  }
46
- export declare function defineOAuthVKEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthVKConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
46
+ export declare function defineOAuthVKEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthVKConfig>): any;
@@ -52,7 +52,7 @@ export function defineOAuthVKEventHandler({
52
52
  })
53
53
  );
54
54
  }
55
- if (query.state !== state) {
55
+ if (!state || query.state !== state) {
56
56
  return handleInvalidState(event, "vk", onError);
57
57
  }
58
58
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -63,4 +63,4 @@ export interface OAuthWorkOSTokens {
63
63
  export declare function defineOAuthWorkOSEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthWorkOSConfig, {
64
64
  user: OAuthWorkOSUser;
65
65
  tokens: OAuthWorkOSTokens;
66
- }>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
66
+ }>): any;
@@ -30,7 +30,7 @@ export function defineOAuthWorkOSEventHandler({ config, onSuccess, onError }) {
30
30
  })
31
31
  );
32
32
  }
33
- if (query.state !== state) {
33
+ if (!state || query.state !== state) {
34
34
  return handleInvalidState(event, "workos", onError);
35
35
  }
36
36
  const authenticateResponse = await requestAccessToken("https://api.workos.com/user_management/authenticate", {
@@ -43,4 +43,4 @@ export interface OAuthXConfig {
43
43
  */
44
44
  redirectURL?: string;
45
45
  }
46
- export declare function defineOAuthXEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthXConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
46
+ export declare function defineOAuthXEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthXConfig>): any;
@@ -50,7 +50,7 @@ export function defineOAuthXEventHandler({
50
50
  })
51
51
  );
52
52
  }
53
- if (query.state !== state) {
53
+ if (!state || query.state !== state) {
54
54
  return handleInvalidState(event, "x", onError);
55
55
  }
56
56
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -28,4 +28,4 @@ export interface OAuthXSUAAConfig {
28
28
  */
29
29
  redirectURL?: string;
30
30
  }
31
- export declare function defineOAuthXSUAAEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthXSUAAConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
31
+ export declare function defineOAuthXSUAAEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthXSUAAConfig>): any;
@@ -27,7 +27,7 @@ export function defineOAuthXSUAAEventHandler({ config, onSuccess, onError }) {
27
27
  })
28
28
  );
29
29
  }
30
- if (query.state !== state) {
30
+ if (!state || query.state !== state) {
31
31
  return handleInvalidState(event, "xsuaa", onError);
32
32
  }
33
33
  const tokens = await requestAccessToken(tokenURL, {
@@ -43,4 +43,4 @@ export interface OAuthYandexConfig {
43
43
  */
44
44
  redirectURL?: string;
45
45
  }
46
- export declare function defineOAuthYandexEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthYandexConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
46
+ export declare function defineOAuthYandexEventHandler({ config, onSuccess, onError, }: OAuthConfig<OAuthYandexConfig>): any;
@@ -48,7 +48,7 @@ export function defineOAuthYandexEventHandler({
48
48
  })
49
49
  );
50
50
  }
51
- if (query.state !== state) {
51
+ if (!state || query.state !== state) {
52
52
  return handleInvalidState(event, "yandex", onError);
53
53
  }
54
54
  const tokens = await requestAccessToken(config.tokenURL, {
@@ -34,4 +34,4 @@ export interface OAuthZitadelConfig {
34
34
  */
35
35
  redirectURL?: string;
36
36
  }
37
- export declare function defineOAuthZitadelEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthZitadelConfig>): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
37
+ export declare function defineOAuthZitadelEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthZitadelConfig>): any;
@@ -43,7 +43,7 @@ export function defineOAuthZitadelEventHandler({ config, onSuccess, onError }) {
43
43
  })
44
44
  );
45
45
  }
46
- if (query.state !== state) {
46
+ if (!state || query.state !== state) {
47
47
  return handleInvalidState(event, "zitadel", onError);
48
48
  }
49
49
  const request = {
@@ -66,7 +66,7 @@ export declare function handlePkceVerifier(event: H3Event): Promise<{
66
66
  code_challenge: string;
67
67
  code_challenge_method: string;
68
68
  } | {
69
- code_verifier: string | undefined;
69
+ code_verifier: any;
70
70
  code_challenge?: undefined;
71
71
  code_challenge_method?: undefined;
72
72
  }>;
@@ -74,7 +74,7 @@ interface HandleStateOptions {
74
74
  isCallback?: boolean;
75
75
  sameSite?: 'lax' | 'none' | 'strict';
76
76
  }
77
- export declare function handleState(event: H3Event, options?: HandleStateOptions): Promise<string | undefined>;
77
+ export declare function handleState(event: H3Event, options?: HandleStateOptions): Promise<any>;
78
78
  export declare function parseJwt(token: string): jose.JWTPayload;
79
- export declare function handleNonce(event: H3Event): string | undefined;
79
+ export declare function handleNonce(event: H3Event): any;
80
80
  export {};
@@ -1,129 +1,2 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, {
2
- redirect_uris: [string, ...string[]];
3
- scope?: string | undefined;
4
- response_types?: ["code" | "none" | "token" | "code id_token token" | "code id_token" | "code token" | "id_token token" | "id_token", ...("code" | "none" | "token" | "code id_token token" | "code id_token" | "code token" | "id_token token" | "id_token")[]] | undefined;
5
- grant_types?: ["authorization_code" | "implicit" | "refresh_token" | "password" | "client_credentials" | "urn:ietf:params:oauth:grant-type:jwt-bearer" | "urn:ietf:params:oauth:grant-type:saml2-bearer", ...("authorization_code" | "implicit" | "refresh_token" | "password" | "client_credentials" | "urn:ietf:params:oauth:grant-type:jwt-bearer" | "urn:ietf:params:oauth:grant-type:saml2-bearer")[]] | undefined;
6
- token_endpoint_auth_method?: "client_secret_basic" | "client_secret_jwt" | "client_secret_post" | "none" | "private_key_jwt" | "self_signed_tls_client_auth" | "tls_client_auth" | undefined;
7
- token_endpoint_auth_signing_alg?: string | undefined;
8
- userinfo_signed_response_alg?: string | undefined;
9
- userinfo_encrypted_response_alg?: string | undefined;
10
- jwks_uri?: string | undefined;
11
- jwks?: {
12
- keys: ({
13
- kty: "RSA";
14
- n: string;
15
- e: string;
16
- alg?: "RS256" | "RS384" | "RS512" | "PS256" | "PS384" | "PS512" | undefined;
17
- kid?: string | undefined;
18
- ext?: boolean | undefined;
19
- use?: "sig" | "enc" | undefined;
20
- key_ops?: ("sign" | "verify" | "encrypt" | "decrypt" | "wrapKey" | "unwrapKey" | "deriveKey" | "deriveBits")[] | undefined;
21
- x5c?: string[] | undefined;
22
- x5t?: string | undefined;
23
- "x5t#S256"?: string | undefined;
24
- x5u?: string | undefined;
25
- d?: string | undefined;
26
- p?: string | undefined;
27
- q?: string | undefined;
28
- dp?: string | undefined;
29
- dq?: string | undefined;
30
- qi?: string | undefined;
31
- oth?: [{
32
- d?: string | undefined;
33
- r?: string | undefined;
34
- t?: string | undefined;
35
- }, ...{
36
- d?: string | undefined;
37
- r?: string | undefined;
38
- t?: string | undefined;
39
- }[]] | undefined;
40
- } | {
41
- kty: "EC";
42
- crv: "P-256" | "P-384" | "P-521";
43
- x: string;
44
- y: string;
45
- alg?: "ES256" | "ES384" | "ES512" | undefined;
46
- kid?: string | undefined;
47
- ext?: boolean | undefined;
48
- use?: "sig" | "enc" | undefined;
49
- key_ops?: ("sign" | "verify" | "encrypt" | "decrypt" | "wrapKey" | "unwrapKey" | "deriveKey" | "deriveBits")[] | undefined;
50
- x5c?: string[] | undefined;
51
- x5t?: string | undefined;
52
- "x5t#S256"?: string | undefined;
53
- x5u?: string | undefined;
54
- d?: string | undefined;
55
- } | {
56
- kty: "EC";
57
- crv: "secp256k1";
58
- x: string;
59
- y: string;
60
- alg?: "ES256K" | undefined;
61
- kid?: string | undefined;
62
- ext?: boolean | undefined;
63
- use?: "sig" | "enc" | undefined;
64
- key_ops?: ("sign" | "verify" | "encrypt" | "decrypt" | "wrapKey" | "unwrapKey" | "deriveKey" | "deriveBits")[] | undefined;
65
- x5c?: string[] | undefined;
66
- x5t?: string | undefined;
67
- "x5t#S256"?: string | undefined;
68
- x5u?: string | undefined;
69
- d?: string | undefined;
70
- } | {
71
- kty: "OKP";
72
- crv: "Ed25519" | "Ed448";
73
- x: string;
74
- alg?: "EdDSA" | undefined;
75
- kid?: string | undefined;
76
- ext?: boolean | undefined;
77
- use?: "sig" | "enc" | undefined;
78
- key_ops?: ("sign" | "verify" | "encrypt" | "decrypt" | "wrapKey" | "unwrapKey" | "deriveKey" | "deriveBits")[] | undefined;
79
- x5c?: string[] | undefined;
80
- x5t?: string | undefined;
81
- "x5t#S256"?: string | undefined;
82
- x5u?: string | undefined;
83
- d?: string | undefined;
84
- } | {
85
- kty: "oct";
86
- k: string;
87
- alg?: "HS256" | "HS384" | "HS512" | undefined;
88
- kid?: string | undefined;
89
- ext?: boolean | undefined;
90
- use?: "sig" | "enc" | undefined;
91
- key_ops?: ("sign" | "verify" | "encrypt" | "decrypt" | "wrapKey" | "unwrapKey" | "deriveKey" | "deriveBits")[] | undefined;
92
- x5c?: string[] | undefined;
93
- x5t?: string | undefined;
94
- "x5t#S256"?: string | undefined;
95
- x5u?: string | undefined;
96
- } | {
97
- kty: string;
98
- alg?: string | undefined;
99
- kid?: string | undefined;
100
- ext?: boolean | undefined;
101
- use?: "sig" | "enc" | undefined;
102
- key_ops?: ("sign" | "verify" | "encrypt" | "decrypt" | "wrapKey" | "unwrapKey" | "deriveKey" | "deriveBits")[] | undefined;
103
- x5c?: string[] | undefined;
104
- x5t?: string | undefined;
105
- "x5t#S256"?: string | undefined;
106
- x5u?: string | undefined;
107
- })[];
108
- } | undefined;
109
- application_type?: "web" | "native" | undefined;
110
- subject_type?: "public" | "pairwise" | undefined;
111
- request_object_signing_alg?: string | undefined;
112
- id_token_signed_response_alg?: string | undefined;
113
- authorization_signed_response_alg?: string | undefined;
114
- authorization_encrypted_response_enc?: "A128CBC-HS256" | undefined;
115
- authorization_encrypted_response_alg?: string | undefined;
116
- client_id?: string | undefined;
117
- client_name?: string | undefined;
118
- client_uri?: string | undefined;
119
- policy_uri?: string | undefined;
120
- tos_uri?: string | undefined;
121
- logo_uri?: string | undefined;
122
- default_max_age?: number | undefined;
123
- require_auth_time?: boolean | undefined;
124
- contacts?: string[] | undefined;
125
- tls_client_certificate_bound_access_tokens?: boolean | undefined;
126
- dpop_bound_access_tokens?: boolean | undefined;
127
- authorization_details_types?: string[] | undefined;
128
- }>;
1
+ declare const _default: any;
129
2
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-auth-utils",
3
- "version": "0.5.31",
3
+ "version": "0.5.32",
4
4
  "description": "Add Authentication to Nuxt applications with secured & sealed cookies sessions.",
5
5
  "repository": {
6
6
  "type": "git",