So I have to create another form for filling in these details.??
There are some websites that use Google data though
Once the user logins with Google, you can get the data from Appwrite
I want on get Google data on sign-up so I create user table with photo url, name, email etc from google
You mean externally, and not in Appwrite, true?
In appwrite
Then the solution is without any doubts the one I suggested you: after the user logins, you get the name, email, etc with a function and create a new document in a collection with such data
Just like in some websites you just sign in with Google and all other info is fetched from google acc
How do you get name and email from google auth
Appwrite gets it and creates an account
You get it from the account created
Does it also get the photourl
Nope
Unfortunately it doesn't because if I remember well, its a sensitive scope
Lemme check the outh2 function and see how to fetch name and email so i can put it in the users table
I do it this way:
- User clicks login with Google button
- If the Auth flow is correct, the function is triggered from client side
- In the function I get the user that triggered the function and I create with such data a new document
It will not duplicate data if you set document ID as user ID, since it it's an user that logins again, it will throw an error of document with an existing ID
Yes yes
It's possible to do it too with appwrite account creation action, but I prefer that way 😅 (Mainly because in old appwrite versions oAuth didn't trigger that)
Also I recommend triggering it in async mode
Same for apple oauth right.?
Yes, same for all oAuth and even email registering
After creating an oauth session, fetch the session. It should have an access token from the oauth provider. You can try using that access token to make API calls to the provider and fetch other things like profile picture
Lemme try this one. Thanks @Steven
this is also my way to handle with this situation. Good luck
Recommended threads
- Current User is Not authorized
recreating same Thread
- Apple OAuth Scopes
Hi Hi, I've configured sign in with apple and this is the response i'm getting from apple once i've signed in. I cant find anywhere I set scopes. I remember se...
- Sign In With Apple OAuth Help
Hi All! I've got a flutter & appwrite app which Im trying to use sign in with apple for. I already have sign in with google working and the function is the sam...