Skip to content

Demo Users

Compare
Choose a tag to compare
@aaronn aaronn released this 16 Aug 20:15
· 29 commits to master since this release

This release adds demo users via the 'PASSWORDLESS_DEMO_USERS': {} setting for App Store Approvals. Thanks for the contribution @budlight.

  • This takes a mapping of user pk to token.key.

Token Generation

  • If a token already exists for the demo user, the first one will be returned.
  • If a token doesn't already exist for the demo user, it will be created with the value mapped to the user key in the dict.

Token Expiry

  • Any user with a token in this dict will not have their token invalidated on use.
  • validate_token_age will always return True if the token's user is in the demo list.

Future Avenues

  • A future variant of this can rely on a model and an admin interface instead of hardcoding a demo user into settings.
  • This would doubly be better because demo credentials can be enabled and disabled.
  • Also, doesn't require a redeploy, which is nice.