#Google Auth not Working

12 messages · Page 1 of 1 (latest)

static grove
#

I'm trying to login a User using google auth after setting up everything in the google cloud console still the user that doesn't exist in the appwrite gets redirect to the dashboard page instead of signup page below is the code.

`import { Client, Account, ID } from "appwrite";
import config from "../conf/config";
const client = new Client();
const account = new Account(client);

client.setEndpoint(config.appwriteURL).setProject(config.appwriteProjectID);

export class authService{

oAuth(){
    try {
        account.createOAuth2Session('google','http://localhost:3000/dashboard', 'http://localhost:3000/signup')
    } catch (error) {
        console.log(error)
        return false
    }    
}

}

const authServices = new authService();
export default authServices;`

`"use client"
import authServices from "../../authentication/auth";
import styles from "./styles.module.css";
import { useState } from "react"
import { useRouter } from "next/navigation";

const Login = () => {

const googleAuth = (e) => {
    e.preventDefault()
    try {
        authServices.oAuth()
    } catch (error) {
        console.log(error)
    }

}

return (
    <div className={styles.Login}
        <h3>Login Using Google</h3>
        <button onClick={(e) => googleAuth(e)}>Google Login</button>
    </div>
)

}

export default Login;`

river wren
static grove
river wren
static grove
river wren
static grove
#

I tried github login as well it gets succesfully logged in but I cannot see any user that exist in the appwrite auth with the same email id that was used to sign in to github or google

static grove
static grove
#

Okay so I tried in a new private window on my browser and it somehow worked don't know where was the error but it eventually worked thanks for replying @river wren appwriteparty appwriterocket