I can log in successful via LinkedIn OAuth and redirected back the successful url, and the user appears in Appwrite Cloud Auth section but getSession("current") throws a 401
Steps to reproduce...
- click login
- redirected to LinkedIn and login
- redirected to successul url on my app
- use
getSession("current")throws a401
const getAppwriteUser = async () => {
let session = {};
try {
session = await account.getSession("current");
let linkedinUser = {};
if (session) {
// fake data, get real profile info from LinkedIn
linkedinUser = {
imageUrl: "https://github.com/eddiejaoude.png",
name: "TEST",
email: "email TEST",
};
}
setUser(linkedinUser);
} catch (e) {
console.log(e);
setUser(null);
}
};
useEffect(() => {
getAppwriteUser();
}, []);
Console error
Failed to load resource: the server responded with a status of 401 ()
What does your code for authenticating look like?
const login = async () => {
account.createOAuth2Session(
"linkedin",
`${process.env.NEXT_PUBLIC_BASE_URL}/success`,
`${process.env.NEXT_PUBLIC_BASE_URL}/failure`
);
};
I am able to log in on LinkedIn and redirected back to /success and my user was created in Appwrite Cloud
Recommended threads
- Any way to temporarily bypass the email ...
Hey guys, any way to bypass the email verification to use the accounts again? i need to recover some projects that due to recent changes have been stopped, and ...
- Collections list not showing up when try...
I'm trying to create new relationship attribute but both one way and two way relationship is not showing up collections list to connect with my relationship att...
- I have try to use the appwrite in to the...
Invalid Origin. Register your new client (oailedjdbkhlkakmnnapoonllbnfmfij) as a new Web (Chrome Extension) platform on your project console dashboard