Back

[SOLVED] how to collect additional info from user when using OAuth?

  • 0
  • Accounts
  • Web
manazo
28 Dec, 2023, 04:50

I'm using OAuth in my app for authentication, but I want to collect additional info from users like their city, zip code, and other stuff. how can I collect these required fields and not create the account info if any of this info isn't provided?

TL;DR
Solution: The user wants to collect additional information from users when using OAuth. There is no workaround to collect additional information during the OAuth process. However, a solution is to create the account first using OAuth and then collect the additional information afterwards. This way, if the user doesn't fill in the required fields, their account will not be considered verified.
Drake
28 Dec, 2023, 05:12

Why can't you create the account first?

manazo
28 Dec, 2023, 05:13

well in that case, if the user doesn't fill the other fields ever, they'll still be counted as a verified user

Drake
28 Dec, 2023, 05:15

So?

manazo
28 Dec, 2023, 05:17

but i wanna keep all the additional info (city, zip code, username) required

Drake
28 Dec, 2023, 05:22

Well you can't because the API doesn't accept any additional params

manazo
28 Dec, 2023, 05:25

yeah, I know. I'm mainly looking if someone can help me with a workaround idea

Drake
28 Dec, 2023, 05:26

I would take the information after creating the oauth session

manazo
28 Dec, 2023, 05:31

well, then is there any way/workaround i can keep the account "unverified" unless the other fields are provided? cuz afaik, createOAuth2Session sets the account as verified

Drake
28 Dec, 2023, 05:42

No. I would use a user label instead

manazo
28 Dec, 2023, 05:46

you mean using a custom attribute in the user doc that indicates if the other fields are filled?

manazo
29 Dec, 2023, 15:21

how to collect additional info from user when using OAuth? [SOLVED]

Drake
30 Dec, 2023, 05:14

[SOLVED] how to collect additional info from user when using OAuth?

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