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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

The parameter PWP__SIGNUP_EMAIL_REGEXP does not work #2082

Open
2 of 11 tasks
CorentinDeBoisset opened this issue Apr 25, 2024 · 7 comments
Open
2 of 11 tasks

The parameter PWP__SIGNUP_EMAIL_REGEXP does not work #2082

CorentinDeBoisset opened this issue Apr 25, 2024 · 7 comments
Labels

Comments

@CorentinDeBoisset
Copy link

CorentinDeBoisset commented Apr 25, 2024

馃悰 Bug Report

When setting the environment variable PWP__SIGNUP_EMAIL_REGEXP, it has no effect. When searching in the code for the usage of the string "regexp" the only matches are the declaration of the parameter but it does not seems to be used anywhere.

馃敩 How To Reproduce

Steps to reproduce the behavior:

  1. Configure pwpush with PWP__DISABLE_SIGNUPS=false and PWP__SIGNUP_EMAIL_REGEXP="\A[^@\s]+@domain\.tld\z"
  2. Create an account for another domain, gmail.com for instance
  3. Receive a sign-up email instead of an error

Code sample

N/A

Environment

Where are you running/using Password Pusher?

  • pwpush.com
  • Docker Image
    • pwpush
    • custom image
  • Heroku
  • Digital Ocean
  • Microsoft Azure
  • Google Cloud
  • AWS
  • Source Code
  • Other (please specify)

If applicable, what version of Password Pusher? 1.35.0

Screenshots

N/A

馃搱 Expected behavior

There should be an error when trying to sign up using an email that does not match the regexp.

馃搸 Additional context

N/A

Copy link

Hello @CorentinDeBoisset, thanks for contributing to the Password Pusher community! We will respond as soon as possible.

@CorentinDeBoisset CorentinDeBoisset changed the title The parameter REGEXP_EMAIL does not work The parameter PWP__SIGNUP_EMAIL_REGEXP does not work Apr 25, 2024
@pglombardo
Copy link
Owner

Hi @CorentinDeBoisset - The regexp is applied here. It plugs into Devise which is the authentication system in use.

I just retested it myself and it works here locally:

Screenshot 2024-04-25 at 21 11 03

Are you sure you applied the environment variable correctly?

Let me know - I can explain in more detail if you like but really the regexp is just passed through into Devise.

@anikwai
Copy link

anikwai commented May 7, 2024

Use single quotation '' for the environment variable works for me. PWP__SIGNUP_EMAIL_REGEXP: '\A[^@\s]+@[^@\s]+\z'

@pglombardo
Copy link
Owner

That's a good point @anikwai - @CorentinDeBoisset have you tried with single quotes? Are you still having this issue?

@pglombardo
Copy link
Owner

Hi @CorentinDeBoisset - let me know if this is still an issue for you. If not, I'll close out this issue soon but you can re-open or file another anytime. I'd be happy to help out.

@riahc3
Copy link

riahc3 commented May 20, 2024

I had to do it without quotes at all..... (PWP__SIGNUP_EMAIL_REGEXP)

@pglombardo
Copy link
Owner

Quotes are required as it's a string that is parsed by the Regexp class.

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

No branches or pull requests

4 participants