-
Notifications
You must be signed in to change notification settings - Fork 174
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
Default domain for username registration #89
Comments
Hello @nwaughachukwuma , apologies for the late reply. |
Hi @sroutier, apologies from me too. We ended up using jQuery to validate the form from the frontend, by adding a domain name as a suffix, such that admin can only add the first part of the user's email as prefix. Let me explain: Say for instance, the domain name is @abc.com, we use @abc.com as the email suffix, such that if a user with official email address [email protected] is to be created, the admin would add xyz to the already existing suffix (@abc.com). This way, using a different domain name raises a modal that show an error message. After this, we went into the CreateUserRequest in App/Http/Request and updated the rules for email to use a regex with the domain name. Something like this 'email' => 'required|unique:users|regex:/^[\w]+(.[\w]+)*(@abc.com)+$/i', This is a rough fix, but it solved the problem. However, I feel there is a better way to achieve this. Hoping to hear from you soon. Thanks |
The way that you did it, looks pretty good. Works for you, that is probably the most important factor. Ciao. |
Awesome. Thanks a lot. Can't wait to begin exploring the new version. |
Hi @sroutier and everybody,
I am using this starter kit to implement a web application that's intended for use within organizations. This implies that users cannot create themselves by signing up, but are created by system admin, and can subsequently login after they are created. This is working fine. But I want admin to only create users working in the organization, and have official email addresses i.e. email addresses with companies domain name. Is there a way to configure this app, probably at config/auth.php to have a default domain for user registration, such that admin cannot register anyone outside the organization, and also such that, as an additional feature, users login with their username, and the system adds the domain name automatically?
The text was updated successfully, but these errors were encountered: