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

403 Error #12

Open
jmvf opened this issue Oct 26, 2022 · 4 comments
Open

403 Error #12

jmvf opened this issue Oct 26, 2022 · 4 comments

Comments

@jmvf
Copy link

jmvf commented Oct 26, 2022

Hi. I have installed the package according to the instructions, and when I register a new user, the registration is successful, but instead of automatically logging into the panel, a 403 error appears, but the user is registered in the Users table. Please, could you tell me how can I fix it ? Thank you.

@jmvf
Copy link
Author

jmvf commented Oct 26, 2022

I must also say that this same 403 error occurs when I try to login with the new registered user. I have discovered the following :
1 - I have cleared the cookies of the site.
2 - I accessed the panel as administrator and I have set the new registered user the main permission.
3 - With this I no longer get the 403 error when logging in.

@tabuna
Copy link
Member

tabuna commented Oct 26, 2022

For a new user to be able to log in to the admin panel, he must have permissions. You can add in the registration event or in any other place that suits you.

@jmvf
Copy link
Author

jmvf commented Oct 26, 2022

Thank you tabuna. Can you tell me how I can automatically assign a permission in the registration event when a user registers through fortify so that he can access the control panel. Thank you very much.

@tabuna
Copy link
Member

tabuna commented Oct 26, 2022

I recommend creating a user role. (In admin panel) And then add it in action app/Actions/Fortify/CreateNewUser.php:

public function create(array $input)
{
    //...

    $role = Role::firstWhere('slug', 'user');
    $user->addRole($role);

    return $user;
}

Then you can change the rights of this group at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants