Yes, But it worked for me for the first time I implemented it
Then probably creating a new project should solve it
Except if it's an issue with your code
Let me try this also
Did, not working
import { Account, Client } from "appwrite";
import appwriteConf from "../config/appwriteConfig";
export class AuthService {
client = new Client();
account;
constructor() {
this.client
.setEndpoint(appwriteConf.appwriteAPI)
.setProject(appwriteConf.appwriteProjectId);
this.account = new Account(this.client);
}
async signInWithGoogle() {
try {
return this.account.createOAuth2Session(
"google",
"http://localhost:5173/register",
"http://localhost:5173/"
);
} catch (error) {
console.log(`Error while logging In: ${error}`);
}
}
async getUserInfo() {
try {
const session = await this.account.getSession('current');
console.log(session);
return session;
} catch (error) {
console.log(`Error while Fetching user: ${error}`);
}
}
}
const authService = new AuthService();
export default authService;
auth.js
register.js
try {
await authService.getUserInfo();
} catch (error) {
console.log(`Error while Fetching user: ${error}`);
}
};
useEffect(() => {
getUser();
}, []);
This is my code
Do you get error logging in?
Are you using any framework?
Vite + React
I see. As long as you don't use any SSR feature it will be fine
Okay
You're trying to get current user info, true?
Try using account.get(); instead. Let's see if it works
wait
same error
Would you please sign in using oauth, but have the network logs open to capture all of the network requests? I think the request that sets the cookie is the /redirect request. Look in the response headers of that request to see what the set cookie is
It's just these two requests
there should be some more. it wont be a fetch request. probably a doc request
where can I see them?
Recommended threads
- Custom API domain is unreachable
Earlier my custom api domain was working fine. Now it seems to be offline without a trace a few hours later. I didn't change anything, all the relevant DNS reco...
- "Invalid console fingerprint" when unpau...
I've tried logging out and logging back in, still can't figure out why this is happening.
- Inviting members while SMTP is disabled ...
Issue: https://github.com/appwrite/console/issues/3125 PR: https://github.com/appwrite/console/pull/3126