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
- education plan not activated
Hi I have an edu id 13103046@iubat.edu but when I am trying to claim my plan and trying to logging with github where education student plan active. the appwrite...
- 500 simultaneous OAuth logins from the s...
Hi, I'd like to ask about rate limiting around Google OAuth login on Appwrite Cloud. **OVERVIEW** Service type: A PWA (web app) for members of a university clu...
- Suspicious access pattern detected when ...
Hello, I am having trouble restoring my project. In the past it worked with no problems, but today I get an error "Suspicious access pattern detected". How can ...