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

Allow users to disable registrations #141

Merged
merged 8 commits into from
Dec 4, 2024
Merged

Conversation

bobbyiliev
Copy link
Contributor

@bobbyiliev bobbyiliev commented Nov 17, 2024

As per a few user requests on the DevDojo site:

https://devdojo.com/question/auth-package-option-to-disable-registration
https://devdojo.com/question/how-to-diable-registration-feature-using-filamentphp-and-auth-package

Implementing that functionality. When disabled if someone visits the register route they will be redirected to the /login route and see the following message:

image

@bobbyiliev bobbyiliev requested a review from tnylea November 17, 2024 15:31
@bobbyiliev bobbyiliev force-pushed the allow-registration-disabling branch from 7f59e68 to b3c2c94 Compare November 18, 2024 08:10
<span class="opacity-[47%]"> {{ config('devdojo.auth.language.login.dont_have_an_account') }} </span>
<x-auth::elements.text-link data-auth="register-link" href="{{ route('auth.register') }}">{{ config('devdojo.auth.language.login.sign_up') }}</x-auth::elements.text-link>
</div>
@if(config('devdojo.auth.settings.registration_enabled'))
Copy link
Contributor

Choose a reason for hiding this comment

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

We may want to add a default value of true in this config, like so:

@if(config('devdojo.auth.settings.registration_enabled', true))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, just updated that!

@tnylea
Copy link
Contributor

tnylea commented Nov 18, 2024

Thanks for adding the test to these. Would this also prevent people from registering using Social Auth like Google or Github?

@bobbyiliev bobbyiliev requested a review from tnylea December 1, 2024 15:03
@bobbyiliev
Copy link
Contributor Author

Thanks for adding the test to these. Would this also prevent people from registering using Social Auth like Google or Github?

I've just extended the PR to include that as well!

So now this includes:

  • Users can disable all registration as per popular demand
  • Users can also disable email registrations and leave only social registrations if they whish to

@tnylea
Copy link
Contributor

tnylea commented Dec 4, 2024

Thanks dude! This looks great.

I've added a few more options and configs. Now, you can center align the text. I've also removed the separator if the user has disabled email registration 😉

CleanShot 2024-12-03 at 20 51 52@2x

Copy link
Contributor

@tnylea tnylea left a comment

Choose a reason for hiding this comment

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

So great! Can't wait to use our Auth package on DevDojo ;)

@tnylea tnylea merged commit 1b04d44 into main Dec 4, 2024
2 checks passed
@bobbyiliev bobbyiliev deleted the allow-registration-disabling branch December 5, 2024 08:40
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