Laravel-admin: Keep redirecting on /auth/login page

Created on 10 Apr 2020  ·  2Comments  ·  Source: z-song/laravel-admin

  • Laravel Version: 7.5.2
  • PHP Version: 7.2
  • Laravel-admin: 1.7.14

Description:

After installing my project using Laravel Deployer in production server, I cannot perform a login.
The response code of the /auth/login endpoint is 301 Moved Permanently. Locally it works pretty well.

In production I'm in a third-level domain, and I've removed the /admin prefix from the configuration.
I've also tried creating a different account using the artisan command but it keeps redirecting me over the login page.

Steps To Reproduce:

  1. Install the project in production with Laravel Deployer
  2. Run php artisan admin:install to seed the database
  3. Perform the login

Most helpful comment

I solved by changing the https configuration in admin.php

/*
    |--------------------------------------------------------------------------
    | Access via `https`
    |--------------------------------------------------------------------------
    |
    | If your page is going to be accessed via https, set it to `true`.
    |
    */
    'https' => env('ADMIN_HTTPS', true),

All 2 comments

I solved by changing the https configuration in admin.php

/*
    |--------------------------------------------------------------------------
    | Access via `https`
    |--------------------------------------------------------------------------
    |
    | If your page is going to be accessed via https, set it to `true`.
    |
    */
    'https' => env('ADMIN_HTTPS', true),

Same it happened when I deployed to live but then I also needed to reset my config files with:
php artisan config:clear and then php artisan config:cache. Rookie mistake on my part.

Was this page helpful?
0 / 5 - 0 ratings