Back

[Solved] Update email if logged in by Magic URL

  • 1
  • Accounts
  • Web
Ajit Singh
14 Jul, 2023, 10:06

I have 2 types of login with Phone and Magic URL I want to allow people to login via phone and add email also later on so that they can login via magic url too if they want to but a password is required to update the email is there any other way to update the email without using the password with the client sdk.

TL;DR
Solution: The user wants to update the email without using a password. It is stated that if a password is set when updating the email, it could create a security issue as the password would need to be saved and passed again for future changes. The solution is to pass any value as the password when updating the email, as it doesn't matter if the user doesn't have a password. It is also mentioned that currently, the password is required and not optional for this operation.
joeyouss
14 Jul, 2023, 16:25

Hi

joeyouss
14 Jul, 2023, 16:25

Unfortunately, seems like it is required rn and not optional

Drake
15 Jul, 2023, 00:43

Just pass any value. It doesn't matter what is passed if they don't have a password.

Ajit Singh
15 Jul, 2023, 02:05

But if I create a password for them won't that be a security issue because then to update the phone ever again I have to save the password and put it there again and for adddtional email edits too

Drake
15 Jul, 2023, 05:24

I'm not sure what you mean. If they don't have a password, it won't set a password. The password you pass in will be ignored

Ajit Singh
15 Jul, 2023, 08:06

Okay I did not knew that it will not set it thanks

Ajit Singh
15 Jul, 2023, 08:07

I thought IF I set something then I need to save it in the DB and pass it on furter changes in email and phone

Drake
15 Jul, 2023, 15:03

Actually sorry, I was wrong. The password that's passed in will actually set. so your UI can show something to say if you don't have a password, this will set the password

Drake
15 Jul, 2023, 15:05

I think we wanted to change this so that it wouldnt update the password, but that would be a breaking change 😕

Ajit Singh
15 Jul, 2023, 23:47

But showing that won't make sense as I use magic url and phone, both don't use password so that won't make any sense

Ajit Singh
15 Jul, 2023, 23:49

Can you tell me if someone can log in via password if I disable email/password option

Ajit Singh
15 Jul, 2023, 23:50

If I set it myself it is not a security issue just making sure

Drake
16 Jul, 2023, 02:21

No they can't

Drake
16 Jul, 2023, 02:22

Maybe use an Appwrite Function and server sdk then

Ajit Singh
16 Jul, 2023, 02:24

Thanks for your help I will use a function then

Ajit Singh
16 Jul, 2023, 02:25

Should i raise a feature request on github for this?

Drake
16 Jul, 2023, 02:30

You can

Ajit Singh
20 Jul, 2023, 04:10

[Solved] Update email if logged in by Magic URL

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