Back

authentication

  • 0
  • Flutter
Joshima
13 May, 2023, 15:15

i am new to appwrite and i am using flutter from a long time now so i wanted to do authentication and on first page uses have to enter FullName and email and then i will send them magicurl on their email and when they are verified then they will be routed to a page when they sets username and password. there is not much stuff about it online idk what to do anymore

TL;DR
The user is experiencing difficulties with authentication in their app. They mention that getting the session in the app requires extra steps and suggest updating Appwrite. They also mention that a URL needs to be provided in the email sent to the user. The user is looking for clarification on using magic URL authentication with Flutter and Appwrite. They share some code they have created for auth_api. They mention that they want users to enter their full name and email on the first page, and then receive a magic URL on their email for verification. Once verified, users should be directed to a page where they can set their username and password. Solution: The user
Drake
13 May, 2023, 15:23

Using magic URL authentication creates an account and session. Then, you can use the update password API to set a password

Joshima
13 May, 2023, 17:38

can you please elaborate

Drake
13 May, 2023, 17:39

Which part? What do you need clarification on?

Joshima
13 May, 2023, 19:06

i have created this in my auth_api -

Joshima
13 May, 2023, 19:06

Future<Token> createmagic( { required String email } ) async { try { final user = await account.createMagicURLSession( userId: ID.unique(), email: email); return user; } finally { notifyListeners(); } }

Joshima
13 May, 2023, 19:06

and i am calling it on the 'send link' button of my sign up page

Joshima
13 May, 2023, 19:07

what after that? do i have to use updatemaggicurlsession?

D5
13 May, 2023, 19:24

Well, supposedly appwrite handles that: https://dev.to/appwrite/magic-url-authentication-with-flutter-appwrite-349g But in my experience didn't worked

Drake
13 May, 2023, 19:25

No it doesn't work. We need to update the docs

Drake
13 May, 2023, 19:25

You need to provide a url that will be in the email sent to the user. The link should send the user back to your app so you can finish the flow with the update call.

See https://discord.com/channels/564160730845151244/1105435044740349993

D5
13 May, 2023, 19:26

And why not updating instead appwrite? πŸ˜…

Drake
13 May, 2023, 19:28

The problem is getting the session in the app requires extra steps

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