I've been working on one open source project where NextJS + Appwrite is used. I want to integrate SignIn with Github in that application. On clicking signin with github, its not redirecting to the URL I am expecting instead it refreshes and stays on same page. In console, it shows 401 unauthorized and "User (role: guests) missing scope (account)". I have attached the screenshot for the reference.
Code:
auth.api.ts
const loginWithGithub=async()=>{
try {
const userData = account.get();
console.log(userData);
account.createOAuth2Session(
"github",
"http://localhost:3000/feed",
"http://localhost:3000"
)
} catch (error) {
console.log(error);
}
}
Client side
<button
className="px-4 py-2 flex flex-row text-sm md:text-base rounded border text-black bg-white transition duration-300 ease hover:bg-secondary hover:text-white items-center"
onClick={async(e) => {
e.preventDefault();
e.stopPropagation();
await loginWithGithub();
router.push('/feed');
}}
>
<span>Login with Github</span>
</button>
Recommended threads
- CORS errors in Obsidian custom plugin
Hi, anyone here familiar with obsidian community plugins? In short: it's a local first note app which supports writing your own add-ons / plugin But I keep get...
- > AppwriteException: The requested servi...
When trying to read or write from my database I get the following error: > AppwriteException: The requested service is disabled. You can enable the service from...
- Courtesy limit reset for non-profit migr...
Hi Team! I'm the architect for a 501(c)(3) non-profit project (Aaria's Blue Elephant) and we just hit our Free plan Database Read limit (currently at 164%). Th...