#My Appwrite login is failing

1 messages · Page 1 of 1 (latest)

buoyant whale
#

Hello team, I’m facing a login issue with appwrite this morning. I started receiving customer support emails that they can’t login. I haven’t changed or pushed anything since the last time everyone was able to log in so I don’t know what changed.

When checked on my local server, it says “ ERROR Login error: [AppwriteException: Invalid token passed in the request.]

I don’t really understand how to approach fixing this and it’s currently locking many people out of my app.

frank raven
#

Same problem with me, but on web (React)

fringe marlin
#

Same problem, I started getting the "AppwriteException: Invalid token passed in the request." error on Google Auth. (React Native + Expo Router)

#

<@&634618551491100692>

#

@buoyant whale the problem been solved?

hazy swallow
#

@fringe marlin It has been less than an hour...

#

Avoid pinging random roles

#

And create a new post instead

fringe marlin
#

@hazy swallow Thanks for the information.

buoyant whale
#

Hello, I’m still having this issue since morning. My app is live so this is resulting in a lot of customer loss for me

fringe marlin
#

@buoyant whale I'm sorry to hear that, my friend. I'm still experiencing the same problem. I hope it gets resolved soon.

finite citrus
#

I am taking a look very quickly, give me a moment and Ill share update

#

I am working on resolving this ASAP. In the meantime, it would be very very helpfup if you can provide steps to reproduce, so we can fix this in safe environment

#

I dont feel confident finding a quick fix. We will be reverting recent change and following-up with a fix before re-releasing again. Any insights you have about the issue is highly valuable 🙌
We will also be adding test once the underlying issue is discovered, to ensure this doesnt happen again.

grave bridge
#

Same here. None of my users are able to login and I am unable to login to admin cosole.

uncut bluff
#

@fringe marlin @grave bridge @buoyant whale @frank raven what login method are you using and what errors are you getting?

fringe marlin
#

Of course, I'll try to help you.

frank raven
buoyant whale
#

I’m using the account.createOAuth2Token for Oauth, and I’m also using an email and password system setup. Both were breaking.

The error happens after the user has selected an email address, during the redirect. Here’s the error:

ERROR Login error: [AppwriteException: Invalid token passed in the request.]

fringe marlin
#

Currently, only Google Auth login is active in my project.

When the user clicks the button, Chrome WebView opens. After logging into Google and closing the browser, the membership appears via Appwrite, but the session does not start. It gives a token error. The error I get is only as follows: "AppwriteException: Invalid token passed in the request."

Here's how the code looks:
`` static async signInWithGoogle(): Promise<User> {
try {
const redirectUri = Linking.createURL('oauth-callback');

  const loginUrl = await account.createOAuth2Token({
    provider: OAuthProvider.Google,
    failure: redirectUri,
    success: redirectUri
  });

  if (!loginUrl) {
    console.error('No OAuth URL returned from Appwrite');
    throw new Error('OAuth URL not generated');
  }

  const result = await WebBrowser.openAuthSessionAsync(
    loginUrl.toString(),
    redirectUri
  );

  if (result.type === 'success' && result.url) {
    const url = new URL(result.url);

    const userId = url.searchParams.get('userId');
    const secret = url.searchParams.get('secret');

    await account.createSession({
      secret: secret!,
      userId: userId!
    });

    const currentUser = await this.getCurrentUser();

    this.saveUserToDatabase(currentUser).catch(error => {
      console.error('Error saving user to database:', error);
    });

    return currentUser;
  } else if (result.type === 'cancel') {
    throw new Error('OAuth sign in was cancelled');
  } else {
    throw new Error('OAuth sign in failed');
  }
} catch (error) {
  console.error('Sign in with Google error:', error);
  throw error;
}

}``

grave bridge
#

@uncut bluff I am using account.createEmailSession(email, password);

frank raven
uncut bluff
#

@frank raven @grave bridge @fringe marlin @buoyant whale can you please confirm if this is now working?

buoyant whale
fringe marlin
#

It's working 🎊

buoyant whale
#

Oauth now works. Email/password login still doesn’t work

grave bridge
#

@uncut bluff Email Password login still not working

finite citrus
#

Looking further 🔎 Do you ahve some URL you could share, for me to easily reproduce?

grave bridge
#

Also I am unable to login to admin console.

uncut bluff
grave bridge
#

@uncut bluff I signed up 2 years ago. I am unable to reset password too. It's giving me same error

#

It was working fine 2 days ago.

uncut bluff
uncut bluff
buoyant whale
#

Also, on my admin, it logs in successfully, it’s currently failing only in my app

uncut bluff
uncut bluff
buoyant whale
#

What console? Appwrote console?

uncut bluff
buoyant whale
#

No. Was referring to my personal web admin dashboard for my app

uncut bluff
buoyant whale
#

Around 14 days ago. But my admin dashboard doesn’t have an issue

#

Just checked the appwrite console and my email/pass for the reviewer login which was hardcoded doesn’t exist anymore, that’s what must be causing the issue

#

I have no idea why it deleted

uncut bluff