-
Notifications
You must be signed in to change notification settings - Fork 152
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
There is no demo credentials to test the login #45
Comments
Interesting– any ideas for how we should handle this in a sane way? |
I added this for this exact purpose: https://github.com/charleshan/django-rest-framework-passwordless/commits/master There's definitely room for improvement. I just added enough to pass the review process (e.g. The password is hardcoded 😂) |
i hit the same issue with app store reviews. until one of the proposed PRs gets merged, i'm hacking/working around it with a signal: @receiver(signals.pre_save, sender=passwordless.CallbackToken)
def update_demo_account_token(sender, instance, **kwargs):
"""
Intercept and update demo account's login token to a constant value.
"""
demo_token = settings.DEMO_TOKEN_VALUE
auth_type = passwordless.CallbackToken.TOKEN_TYPE_AUTH
# check for callback token creation for the demo account
if instance.user.email != settings.DEMO_USER_EMAIL or instance.type != auth_type or not instance.is_active:
return
# tokens can only be used once so we need to delete it from the db
if passwordless.CallbackToken.objects.filter(key=demo_token, type=auth_type).exists():
passwordless.CallbackToken.objects.filter(key=demo_token, type=auth_type).delete()
instance.key = demo_token |
I previously integrated ios app with django passwordless. On submiting the app for review they are asking a demo account from which they can login without having to enter the six digit code. is there any way to create demo credentials for mobile login with phone number and a fixed 6 digit code?
The text was updated successfully, but these errors were encountered: