Aditya Pundir
If i put localhost in my redirect url it works fine
TypeScript
if(providerid === "google"){
authurl = await account.createOAuth2Token(
OAuthProvider.Google,
"https://localhost:3000/extractParam",
"https://localhost:3000/unexpected");
}```
but when i put the link of my deployed website on vercel and call the auth fxn from the deployed url it gives me "Invalid redirect" message in response
```const { account } = await createAuthAdminClient();
if(providerid === "google"){
authurl = await account.createOAuth2Token(
OAuthProvider.Google,
"https://0xdeadlock.vercel.app/extractParam",
"https://0xdeadlock.vercel.app/unexpected");
}```
this is the response object:
{
"data": {
"error": "Invalid redirect"
},
"status": 500,
"statusText": "Internal Server Error",
"headers": {
"connection": "keep-alive",
"content-type": "application/json",
"date": "Thu, 11 Jul 2024 19:24:05 GMT",
"keep-alive": "timeout=5",
"transfer-encoding": "chunked",
"vary": "RSC, Next-Router-State-Tree, Next-Router-Prefetch"
},
"config": {
"transitional": {
"silentJSONParsing": true,
"forcedJSONParsing": true,
"clarifyTimeoutError": false
},
"adapter": [
"xhr",
"http",
"fetch"
],
"transformRequest": [
null
],
"transformResponse": [
null
],
"timeout": 0,
"xsrfCookieName": "XSRF-TOKEN",
"xsrfHeaderName": "X-XSRF-TOKEN",
"maxContentLength": -1,
"maxBodyLength": -1,
"env": {},
"headers": {
"Accept": "application/json, text/plain, */*",
"Content-Type": "application/json"
},
"method": "post",
"url": "/api/users/signup",
"data": "{\"providerid\":\"google\"}"
},
"request": {}
}
TL;DR
Issue when deploying URLs for OAuth; error "Invalid redirect".
Solution: Ensure the redirect URIs in your OAuth configuration match the deployed website URL. Recommended threads
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...
- Error: User (role: guests) missing scope...
I want to send a verification code to the user and the given phone number and check it and create a session right after the user entered the secret. For me that...
- Apple OAuth Scopes
Hi Hi, I've configured sign in with apple and this is the response i'm getting from apple once i've signed in. I cant find anywhere I set scopes. I remember se...