Rank 1: Thread
I've been facing troubles trying to authenticate with OAuth (GitHub and Gitlab). I dont know what i am missing so any help would be appreciated and it would be really helpful if someone could provide an example
- When trying to authenticate with Github I either get this error ''Error 400
Invalid success: URL host must be one of: localhost, cloud.appwrite.io, *.vercel.app" or when i leave out the success parameter to be empty "Missing Redirect URL" - With Gitlab iI get directed to appwrite cloud which throws a 404 and takes me to my appwrite dashboard instead of taking me to the Gitlab's OAuth page.
"use client";
import { account } from "@falcon-z/app/utils/appwrite";
export default function LoginButton({
provider,
}: {
provider: "github" | "gitlab";
}) {
const handleAuth = (provider: "github" | "gitlab") => {
account.createOAuth2Session(provider, "localhost:3000/");
};
return (
<button
type="button"
onClick={() => handleAuth(provider)}
>
Login With <span className="first-letter:uppercase">{provider}</span>
</button>
);
}