Error:
AppwriteException: Invalid redirect\n at _Client.redirect
Code:
const origin = getHeaders().origin;
const successUrl = `${origin}/api/oauth`;
const failureUrl = `${origin}/`;
const redirectUrl = await account.createOAuth2Token(
OAuthProvider.Github,
successUrl,
failureUrl,
);
return redirect(redirectUrl);
i'm receiving this error while the origin is my real domain. Everything is working in dev mode with localhost:3000
I'm using latest version of node-appwrite. This code is entirely run by node.
My client is built like the documentation says:
import {Client} from 'node-appwrite';
const client = new Client()
.setProject(projectId)
.setEndpoint(endpoint)
.setKey(apiKey);
i know you're saying you're using the latest version of the node-appwrite SDK, but would you please check the package in your node_modules to verify what version is installed?
it's 14.1.0
I did a test also with 15-rc1
and you're saying it works locally, but not after deploying?
yes, using localhost as success/failure url works fine. Once i put my real domain, i got that error (also in dev mode)
have you double checked your env vars are set up?
and you've added a web platform to your project?
can you share the URL of your app?
Just added some logs in my server functions and I noticed that in prod build I was retrieving the env variables wrongly (import.meta.env instead of process.env) π€¦ββοΈ
I had the cloud url undefined π everything is working fine now.
thanks for the quick response
Recommended threads
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...
- Deep Linking & Password reset
I am using react native with expo. I want to implement deep link with the url recived via email. So when clicked the link it opens my app. I havent ever used de...
- Deploy function not working - 503
Hellon i get this error message, when i try to deploy a new version of a function <html><body><h1>503 Service Unavailable</h1>No server is available to handle...