Back

Verfiy E-Mail without login

  • 0
  • Flutter
  • Auth
  • Cloud
Tobias Kietzmann
6 Mar, 2024, 18:27

Is there any way/workaround to verify an email-address without being logged in? We're building a mobile app and if this isn't possible we have to introduce uni links only for this case - ideally i can setup a simple web page which executes the verfication request with just the userId and the token provided by appwrite

TL;DR
Developers are discussing methods to verify email addresses without requiring users to be logged in. One developer suggests using a Magic URL or creating a function to handle verification via query parameters. Another mentions using a backend or creating an API route for verification. An outdated Github gist is referenced, highlighting the need for a logged-in session for verification. Ultimately, the solution involves creating a simple web page to execute the verification request with the userId and token provided by the app.
Steven
6 Mar, 2024, 18:36

you must log in to trigger the email verification. You can use a separate web page to confirm the email, though

Tobias Kietzmann
6 Mar, 2024, 18:39
TypeScript
Once your user is back in your website or app, you can use both the userId and secret params provided as part of the callback URL to complete the verification using the updateVerification method. Note that this method is only available for logged-in users. Your user needs to have a valid session to trigger this API call.
Tobias Kietzmann
6 Mar, 2024, 18:40
Steven
6 Mar, 2024, 18:44

yes, that's outdated

ZachHandley
6 Mar, 2024, 18:48

You can technically use the backend to confirm the email

ZachHandley
6 Mar, 2024, 18:48

server SDK, can't you?

ZachHandley
6 Mar, 2024, 18:49

couldn't he just make an API route or function route that, when clicked, verifies the user with the passed ID?

Steven
6 Mar, 2024, 18:55

i guess you could create a function and use that function as the redirect URL

Tobias Kietzmann
6 Mar, 2024, 19:04

i will just create a page which parses the query parameters and call a function to verify

Tobias Kietzmann
6 Mar, 2024, 19:05

this should work but then i have to manage tokens by myself i guess

Steven
6 Mar, 2024, 19:09

there are no other tokens needed besides the secret that comes from the email

ZachHandley
6 Mar, 2024, 19:09

I mean you could also use the Server SDK, use a function to do it

Steven
6 Mar, 2024, 19:10

there's no need for a server SDK

ZachHandley
6 Mar, 2024, 19:10

You could also use a Magic URL and then on the confirmation page for the magic URL call it a confirmation no?

ZachHandley
6 Mar, 2024, 19:10

oh true

Tobias Kietzmann
6 Mar, 2024, 19:20

yes so i just can do it very easy, thanks - i just read the gist which looks updated and is official πŸ™‚

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