Randy_Johnson's avatar

Help, login in page redirecting to default laravel login page

Hi, I created a login in portal so that the user is given the choice to login as admin (will probably hide this later) , student, etc. but when I click the link it just redirects me to the login page. But there is absolutely no reason for it to do so.

<?php

use Illuminate\Support\Facades\Route;
use Inertia\Inertia;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Auth;
use Education\App\Models\School;
use Education\App\Models\Building;
use Education\App\Models\Classroom;
use Education\App\Models\Expense;
use Education\App\Models\Message;
use Education\App\Models\Fee;
use Education\App\Models\Teacher;
use Education\App\Models\Subject;
use Education\App\Models\Student;
use Education\App\Models\Form;
use Education\App\Models\Thread;
use Education\App\Models\SchoolFinance;

Route::get('/login', function () {
    return Inertia::render('Auth/Login');
})->name('login');

Route::get('/education/portal', function () {
    return Inertia::render('education/login-portal');
});

PS. I had a problem posting this as well, I selected Laravel and it said recapta failed - or something along them lines.

0 likes
8 replies
JussiMannisto's avatar

when I click the link it just redirects me to the login page

What link?

1 like
Randy_Johnson's avatar

The link on my front page which is to /education/login-portal

There is an issue where I am trying to add a school login page which isn't that of Laravel login. When having the route in the package education web.php it gets pushed to Laravel login but having it in the root web.php it works.

If continuing to log in, it then displays the page, so I am guessing there is some gate somewhere. I am using the standard laravel login which is installed in the creating of the app.

Shivamyadav's avatar

Do you have any starter kit setup or any extra route for the login named below these routes

1 like
Randy_Johnson's avatar

Thanks guys. I found it. It was in my AppServiceProvider

    Route::middleware(['web', 'auth'])
        ->group(__DIR__ . '/../../routes/web.php');

Thank you for listening and many blessings to you all

Tray2's avatar

Just think on this.

A user is a user, don't overthink, or over engineer.

Use a single login page, and handle it with roles/types of users.

1 like
Jsanwo64's avatar

Use the nomal laravel login page, just check for roles (implement this) when they try to login.

jlrdw's avatar

You actually need all of those use statements?

1 like

Please or to participate in this conversation.