As the title says, there are three main privileges.
Role_group is divided into end users, administration, and development.
Although it is overridden in LoginController.php, the login destination after login is divided by authority.
/**
* Overrides protected $redirectTo.
*
* @return string
* /
protected function redirectTo ()
{
\ Log :: info ('After login'. GetPermissionDefaultRoute ());
return route ('development.default');
}
if (! function_exists ('getPermissionDefaultRoute')) {
/ **
* @return string | void
* /
function getPermissionDefaultRoute ()
{
if (Auth :: user ()->isDevelopmentGroup ()) {
return route ('I can't show you A');
}
if (Auth :: user ()->isSupportGroup ()) {
return route ('I can't show you B');
}
if (Auth :: user ()->isEndUserGroup ()) {
return route ('I can't show you C');
}
abort (500, 'Inconsistent root authority'));
}
}
RedirectIfAuthenticated.php
uses the same helper.
When I log in with three privileges, it is skipped to the top page (https://example.com/) for some reason.
Since the top page is the default default page for end users,This action is unauthorized.
and 403 error occurs when you log in with the operation account and development account.
When you back-browser, the URL specified by getPermissionDefaultRoute is displayed in the browser's URL bar.
Probably once i am properly logged in according to your authority.
It is only necessary to know where and why 403 occurs in the state before the transition, but it is difficult because X debugging is not installed.
Is there anyone who has any idea about this?
I don't think it matters much, but
End users can only see the end user's page,
Management can only see the management page,
Development can see the development page as well as the administration page
Gates are defined in Providers.
I use it in middleware.
I think that there is no problem here because it is accessible by back browser.
AppendWhen logging in for the first time in a secret window such as google or firefox, you will jump to the login destination according to your authority.
If i log out and log in again, you will fly to the route.
Is there any kind of session involved?
Even so, where do you fly to the route,
-
Answer # 1
Related articles
- php - i want to redirect to the original page after logging in
- i want to return to the original page after logging in with php
- php: i want to display the database information after inserting the data entered from the form
- php - i want to set the transition destination after posting a comment of wordpress for each comment source page
- php - display method after storing images in array
- after getting the minimum value with php, i want to get a number that does not match the minimum value in the database
- php - localhost:8888 does not connect after installing laravel
- memcached doesn't work after php version upgrade
- php - phenomenon that is not displayed even after uploading an image
- i can't log in to wordpress with a php error after importing with all in one migration
- about syntax error after php version upgrade
- php - suppressing database access after self-authentication using laravel
- page transition after editing from php product correction page does not work
- i want to measure only uu after logging in with google analytics
- php - it doesn't work to remove whitespace and line feed code after converting an array to a string
- php - send button display after entering required items
- i can't open it with "403 forbidden" after installing phpmyadmin
- ruby - i can't transition to my page for each user after logging out (rails)
- php - [laravel] after setting up the auth function, the page that could be displayed until now can no longer be displayed
- php - i want to change a part of the wordpress template after loading it
- The profile.php page does not open
- [php_laravel] how to reflect session data in view file
- php - [laravel aritsan serve] class'barryvdh \ snappy \ serviceprovider' not found is displayed
- php - [wordpress] i got an error and can't log in
- php - e-mail transmission with laravel is garbled
- php - why is the error statement returned in the url even though i wrote it with try catch?
- laravel + minio project throws error in phpunit on bitbucket-pipeline
- php - laravel/ui command "ui" is not defined remedy
- php - about laravel unique validation
- php - laravel 55 membership registration page is not displayed
It was raining in May, but it was solved by explicitly specifying the transition destination when logging out.
Because it was rooted at the end user's default page,
After logging out with each permission, go to end user default page
Since it was not authenticated, a 403 error was displayed.
Why the login destination was root
I don't know the fundamental part of it ...
For reference, the user table is not divided in this example.
The authority is managed below.
Authority group->Authority subgroup->Authority->User
Three routing files have been created, and middleware (Gate) that restricts access by role_id, role_sub_group_id, or role_group_id is designed for each routing file.
Prefix is added to url for each routing file.
I don't think there is a problem with making it, but I couldn't access the login unless I explicitly specified the transition destination when logging out. (Mystery because sometimes I could access it)