Is the login work, and you want to be able to get the user profile image?
Yup I did a work around but it was hectic....If I want create a new User in database. How should I do that ?
Yup I want to get user profile image.
For just creating user programmatically use the Users Server SDK
You can use any of the create functions here: https://appwrite.io/docs/server/users
The sdk is for server side. I want to create users in the client side.
You'll have to do it manually I think.
For Github for example you can use https://api.github.com/search/users?q=torvalds
You'll need to use one of the following
- OAuth2
- Email & Password - https://appwrite.io/docs/client/account?sdk=web-default#accountCreate
- Magic link - https://appwrite.io/docs/client/account?sdk=web-default#accountCreateMagicURLSession
- Phone - https://appwrite.io/docs/client/account?sdk=web-default#accountCreatePhoneSession
Do notice that in phone and magic link there is an extra step.
Why? What exactly are you trying to do?
What should be the flow creating the user like first check if it is already exist in the database if not create then
Are you trying to let users sign up/create their account for your app?
I guess when the user gets logged in during that point of time userData sets to null. That's why I was not able to get the data. So what I did was I waited for the user to log in then after that get the account.get()
Yes sir
Yes, account.get() needs to be called after a session is created
Yup It was not working in the same function even if I use async await
Creating an oauth2 session will automatically create a user if they don't exist.
Otherwise, you can use account.create()
I want to store that data in the database.
Right because of what Byawitz said: https://discord.com/channels/564160730845151244/1111116935938187294/1111119219094994966
It will be better if we could call it in the same function with then and catch statements
How to do that ?
You can't because that's not how the OAuth2 works...the create oauth2 session function opens a new tab/window for the oauth2 flow. After the tab is created, execution continues, but the session hasn't been created yet
okk. Thank you sir got it. Could help how to setup intialise database with name and email after authentication. And also check it already exists ?
Maybe you should read up on database design first. This is a little outdated, but principles still apply https://dev.to/appwrite/30daysofappwrite-database-design-140a
How to get the spotify Authorisation token when logging through AppWrite ?
Are you using nextjs for the frontend?
providerAccessToken from the OAuth2 Session: https://appwrite.io/docs/models/session
Recommended threads
- No server error on selfhosted appwrite
Please help me, my clients is ask what happen on their data? How can i make it up again?
- Upgrading selfhost version?
It is okay to upgrade version to higher one, of my current version is 1.7.4 to 1.8.1. Is that safe to do cause my clients already have data on that? Also is a...
- Streamlit UI and local DB
I want to use Appwrite for automation, like run watchdog service every morning 3 am. Anyone got suggestions, already explored github and documentation no luck. ...