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

Fix bug where demo tokens are not created #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

charleshan
Copy link
Contributor

It looks like these lines are preventing the creation of new tokens with predefined keys so the current implementation doesn't work with existing users. This pull request simply removes those lines.

token = CallbackToken.objects.filter(user=user).first()
if token:
return token
else:
return CallbackToken.objects.create(
user=user,
key=api_settings.PASSWORDLESS_DEMO_USERS[user.pk],
to_alias_type=alias_type_u,
to_alias=getattr(user, to_alias_field),
type=token_type
)

@1beb 1beb mentioned this pull request Feb 8, 2022
to_alias=getattr(user, to_alias_field),
type=token_type
)
return CallbackToken.objects.create(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the way to go: you'd be creating a new callback token every time the user logs in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants