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

How to use google2fa in laravel modular #169

Open
marcelocuba10 opened this issue May 17, 2022 · 0 comments
Open

How to use google2fa in laravel modular #169

marcelocuba10 opened this issue May 17, 2022 · 0 comments

Comments

@marcelocuba10
Copy link

marcelocuba10 commented May 17, 2022

  1. Edit the file "Response.php", located in "vendor\pragmarx\google2fa-laravel\src\Support\Response.php"

use Illuminate\Support\Facades\Auth;

private function getView()
{

    /** Get current Guard name */
    $guard = Auth::getDefaultDriver();

    if ($guard == 'admin') {
        /** Guard Admin is a Module Admin */
        return view($this->config('view_admin'));
    } 

    if ($guard == 'web') {
        /** Guard User is a module User*/
        return view($this->config('view_user'));
    } 

}

///////////////////////////////////////////////////////////////////////////////////////////////////////////

  1. Edit the file "google2fa.php", located in "config\google2fa.php"

    /*

    • One Time Password View Module User.
      */
      'view_user' => 'user::auth.2fa_verify',

    /*

    • One Time Password View Module Admin.
      */
      'view_admin' => 'admin::auth.2fa_verify',

Summary:
When the url starts with the module name, the getView() function redirects to each module's view.

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

No branches or pull requests

1 participant