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

Add support for allowing users based on their domain #1651

Merged
merged 2 commits into from
Jan 16, 2025

Conversation

laurentlb
Copy link
Contributor

e.g.
ALLOWED_USER_DOMAINS=["example.com"]
will allow both [email protected] and [email protected]

A user can log in if one of the conditions is true:

  • ALLOWED_USER_DOMAINS and ALLOWED_USER_EMAILS are empty
  • their email is in ALLOWED_USER_EMAILS
  • their email domain ALLOWED_USER_DOMAINS

Fixes #1650

e.g.
  ALLOWED_USER_DOMAINS=`["example.com"]`
  will allow both [email protected] and [email protected]

A user can log in if one of the conditions is true:
  - ALLOWED_USER_DOMAINS and ALLOWED_USER_EMAILS are empty
  - their email is in ALLOWED_USER_EMAILS
  - their email domain ALLOWED_USER_DOMAINS
Copy link
Collaborator

@nsarrazin nsarrazin left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

@nsarrazin nsarrazin merged commit 1021e2f into huggingface:main Jan 16, 2025
3 checks passed
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.

ALLOWED_USER_EMAILS, but for domain names
2 participants