Back

how to get current user password in flutter from appwrite ?

  • 0
  • Flutter
  • Accounts
Ichigor
22 Dec, 2023, 16:59

I have a user account and I am currently logged in, I am making a screen to change the user's email via a form and in order to change the email I need to get the current password of that user

TL;DR
OP wants to retrieve the current user password in Flutter from Appwrite. Users suggest that there is no direct way to obtain the password. One solution is to have the user enter their password manually to change their email address. Another workaround involves creating a temporary account with the entered password and comparing the password hash. However, it is emphasized that the password cannot be retrieved from Appwrite directly.
Muniraja
22 Dec, 2023, 17:03

@Ichigor The user has to enter the current password. You can't get it from appwrite.

Ernest
22 Dec, 2023, 18:25

Yes, you'd probably want to create a function to do that using the Users api

ideclon
24 Dec, 2023, 18:00

For clarification, you mean OP would want to change the email address with the Users API from a function

ideclon
24 Dec, 2023, 18:01

You still can’t get a user’s password with the Users API.

Ernest
24 Dec, 2023, 18:57

Yes, but it can be accomplished by creating a temporal (dummy) account with the entered password and compare the hash to the password hash of the existing account. The password hash can be obtained via the Users api

ideclon
24 Dec, 2023, 18:59

That’s awful 😆

ideclon
24 Dec, 2023, 19:00

But OP isn’t trying to verify the password the user has entered. They’re trying to get the user’s password

Ernest
24 Dec, 2023, 19:03

Yes, but also understandable due to security reasons

ideclon
24 Dec, 2023, 19:04

No, I mean your workaround

Ernest
24 Dec, 2023, 19:06

My understanding from the original question is OP wants to verify the identity of the user before changing the email I've worked on apps with similar functionality. In fact, if that's the case it's just easier to use a function to try logging in with the supplied email and password then upon successful login effect the change

ideclon
24 Dec, 2023, 19:08

The change email function requires the current password already

Ernest
24 Dec, 2023, 19:08

Understandable, but I can't think of any other way of getting the password. The best one can get is the password hash

Ernest
24 Dec, 2023, 19:09

Oh ok then my bad 😅

ideclon
24 Dec, 2023, 19:09

It sounds like OP just wants the user to not have to enter the password when they want to change the email address on the account

ideclon
24 Dec, 2023, 19:10

It uses up your MAU limit (if you’re on Cloud)

Ernest
24 Dec, 2023, 19:13

Ok

Ernest
24 Dec, 2023, 19:13

@Ichigor You'd have to clarify things a bit

ideclon
24 Dec, 2023, 19:14

I think it’s just - there’s no way, just have the user enter their password

Ernest
24 Dec, 2023, 19:15

I agree

Ernest
24 Dec, 2023, 20:37

Just clocked why this statement was confusing to me. Op wants to change email and not password. It's not a forgot password problem but a change email problem.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more