Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear behaviour of createPhoneSession and createMagicURLSession #641

Open
Megamannen opened this issue Sep 8, 2023 · 0 comments
Open
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@Megamannen
Copy link

Megamannen commented Sep 8, 2023

Very unclear on what happens when you provide and ID (since it is required) but the Phone / Email already exists,

if you set the user limit to some low number and someone calls createMagicURLSession() or createPhoneSession(), but their account (match on email or phone respectively) doesn't exist, they will get an error.

createMagicURLSession() code:

https://github.com/appwrite/appwrite/blob/891099c7c3dc1fe86c4e64467f9249651991b603/app/controllers/api/account.php#L920

createPhoneSession() code:

https://github.com/appwrite/appwrite/blob/891099c7c3dc1fe86c4e64467f9249651991b603/app/controllers/api/account.php#L1258

it's impossible to provide the matching [USER_ID]

You don't need to provide a matching user id when just logging in. that user id parameter is only used during account creation. Otherwise, it's ignored.

Originally posted by @stnguyen90 in appwrite/appwrite#6154 (comment)

Proposal: documentation and minor code change

Remove the "required" tag of ID and change it to this:

USER_ID [optional] if provided and the user doesn't exist, it will be created with this ID, else it will get a new Unique ID.
EMAIL/PHONE [required]

Will return error if user limit is reached and email/phone doesn't already exist

@eldadfux eldadfux transferred this issue from appwrite/appwrite Feb 19, 2024
@eldadfux eldadfux added the documentation Improvements or additions to documentation label Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants