Skip to content

Commit

Permalink
fix: add missing imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Azurency committed Dec 4, 2023
1 parent ff45896 commit 119ca71
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/runtime/server/utils/security.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { H3Event } from 'h3'
import { type H3Event, setCookie, getCookie, getQuery, createError } from 'h3'
import { subtle, getRandomValues } from 'uncrypto'
import { useRuntimeConfig } from '#imports'

export type OAuthChecks = 'pkce' | 'state'

Expand Down Expand Up @@ -69,11 +70,11 @@ export const checks = {
const pkceChallenge = await pkceCodeChallenge(pkceVerifier)
res['code_challenge'] = pkceChallenge
res['code_challenge_method'] = 'S256'
setCookie(event, 'nuxt-auth-util-verifier', pkceVerifier, { ...runtimeConfig.nuxtAuthUtils.security.cookie })
setCookie(event, 'nuxt-auth-util-verifier', pkceVerifier, runtimeConfig.nuxtAuthUtils.security.cookie)

Check failure on line 73 in src/runtime/server/utils/security.ts

View workflow job for this annotation

GitHub Actions / test

Argument of type '{ secure: boolean; httpOnly: boolean; sameSite: string; maxAge: number; }' is not assignable to parameter of type 'CookieSerializeOptions'.
}
if (checks?.includes('state')) {
res['state'] = generateState()
setCookie(event, 'nuxt-auth-util-state', res['state'], { ...runtimeConfig.nuxtAuthUtils.security.cookie })
setCookie(event, 'nuxt-auth-util-state', res['state'], runtimeConfig.nuxtAuthUtils.security.cookie)

Check failure on line 77 in src/runtime/server/utils/security.ts

View workflow job for this annotation

GitHub Actions / test

Argument of type '{ secure: boolean; httpOnly: boolean; sameSite: string; maxAge: number; }' is not assignable to parameter of type 'CookieSerializeOptions'.
}
return res
},
Expand Down

0 comments on commit 119ca71

Please sign in to comment.