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
- Problem with Google Workspace at DNS Rec...
Hello, I bought a domain at Namecheap, and Google Workspace used to work there, but now that I switched from Custom DNS to Appwrite's nameservers, it doesn't w...
- change role of a team member in Appwrite
It's not possible to add/change roles of a team meber in Appwrite Frontend. When you click on a member of a team you get forwarded to the configuration page of ...
- Session not found. Please run appwrite l...
I have encounter an issue with appwrite CLI They asking for a login session but in the doc, itβs mention that only setup client with endpoint / api key is enou...