Rank 3: Container
Hi, is there any way now for checking if the users password is correct in a function? I am creating a delete user function and before deleting I would like to check if the given password is correct.
Votes
0
Replies
13
Participants
2
Messages
14
Rank 3: Container
Hi, is there any way now for checking if the users password is correct in a function? I am creating a delete user function and before deleting I would like to check if the given password is correct.
U can create a new auth session by using the logged in email of the user and the typed password entered by the user, if the session is validated u can delete the user and delete all active sessions
U can generate a short lived JWT token if the session is validated and pass it to appwrite function
Rank 3: Container
I tried it but auth doesnt work in functions
Rank 3: Container
It says the application is missing the required permission: account
Rank 3: Container
And there is no account in the dynamic api key permissions
What I mean is
Authenticate the user again in the frontend, if successful create a jwt with user ID in the token's payload and pass that jwt to Appwrite Function, Verify and the Token Secret inside the function and decode the jwt and delete the user by the user id u get from jwt payload
Can u share the screenshot if u dont mind??
Rank 3: Container
Oh I understand Ill try that thanks
Yea sure np :))
Rank 3: Container
Im not there at the moment but I will if I remember
Rank 3: Container
Thank you for your help :)
Alright 👍
npp :))