Commit 7b53d20
Fix PKCE code verifier authentication error
Add explicit cookie configuration for PKCE code verifier to resolve
'InvalidCheck: pkceCodeVerifier value could not be parsed' error.
This fixes an issue where OAuth authentication would fail on first attempt
due to NextAuth v5 not having explicit cookie settings for PKCE flow.
The explicit configuration ensures cookies are properly stored and retrieved
during the OAuth callback, preventing authentication failures.
- Add pkceCodeVerifier cookie configuration with proper security settings
- Use dynamic secure flag based on AUTH_URL protocol (HTTP vs HTTPS)
- Set appropriate cookie options (httpOnly, sameSite, path, maxAge)
- Handle undefined AUTH_URL during build time with optional chaining
Co-authored-by: Brendan Kellam <brendan@sourcebot.dev>1 parent fb358d8 commit 7b53d20
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
161 | 173 | | |
162 | 174 | | |
163 | 175 | | |
| |||
0 commit comments