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

Is it possible to force optional #51

Open
akiftezcan38 opened this issue Oct 7, 2024 · 4 comments
Open

Is it possible to force optional #51

akiftezcan38 opened this issue Oct 7, 2024 · 4 comments
Labels
wontfix This will not be worked on

Comments

@akiftezcan38
Copy link

akiftezcan38 commented Oct 7, 2024

What happened?

Hello.

forced() function forces 2FA for the whole system

but

I want to force 2fa for some users. but I don't want to force it for some users. is there a way I can do this?

Can you help me

How to reproduce the bug

that's it

Repository

filament-2fa

Package Version

1.6

PHP Version

8.2

Laravel Version

11

Which operating systems does with happen with?

Linux

Notes

No response

@akiftezcan38 akiftezcan38 added the bug Something isn't working label Oct 7, 2024
@Baspa
Copy link
Member

Baspa commented Oct 7, 2024

Unfortunately that's not possible. You should create your own middleware to implement such logic. You could take a look at the middleware in the package for some inspiration. @akiftezcan38

@Baspa Baspa added wontfix This will not be worked on and removed bug Something isn't working labels Oct 7, 2024
@akiftezcan38
Copy link
Author

Unfortunately that's not possible. You should create your own middleware to implement such logic. You could take a look at the middleware in the package for some inspiration. @akiftezcan38

@Baspa Thanks

I think you should add this feature. Because this is a feature that everyone needs.

@Baspa
Copy link
Member

Baspa commented Oct 7, 2024

I might be able to add it in the future, but in the upcoming weeks I don't have any time (due holiday). If you want you could try to change the ForceTwoFactor middleware and submit a PR :) @akiftezcan38

@akiftezcan38
Copy link
Author

I might be able to add it in the future, but in the upcoming weeks I don't have any time (due holiday). If you want you could try to change the ForceTwoFactor middleware and submit a PR :) @akiftezcan38

image

Actually what you do is very simple.

Just add a condition in the RedirectIfTwoFactorAuthenticatable middleware. Also a column in the users table and that's it.

I am not very familiar with the contents of the package, so I avoid opening a Merge request. @Baspa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Development

No branches or pull requests

2 participants