Skip to content

Is it possible to force optional  #51

Open

Description

@akiftezcan38

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

Activity

  1. Baspa commented on Oct 7, 2024

    @Baspa
    Contributor

    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

  2. added
    wontfixThis will not be worked on
    and removed
    bugSomething isn't working
    on Oct 7, 2024
  3. akiftezcan38 commented on Oct 7, 2024

    @akiftezcan38
    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.

  4. Baspa commented on Oct 7, 2024

    @Baspa
    Contributor

    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

  5. akiftezcan38 commented on Oct 18, 2024

    @akiftezcan38
    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

  6. self-assigned this
    on Jan 21, 2025
  7. added
    enhancementNew feature or request
    and removed
    wontfixThis will not be worked on
    on Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions