Questions tagged [laravel-authentication]

Laravel ships with several pre-built authentication controllers for user registration, authentication, and password reset.

Laravel ships with several pre-built authentication controllers for user registration, authentication, and password reset.

376 questions
2
votes
2 answers

After login getting too many redirects error

Whenever I try to add a product to a wishlist I am redirected to a login page where I enter my credentials and after that it keeps reloading and this error appears. Thereafter, when I return to home page and refresh I am logged in. But when I try…
2
votes
1 answer

How to get multi-auth on Laravel Passport to work?

For example, I saw an answer on this website about how you can add multi-auth to Laravel Passport https://stackoverflow.com/a/49449524/5029058 But I don't understand how a user becomes an admin in that answer? Is there like an extra row in the db…
2
votes
1 answer

Dynamically select Laravel authentication driver

Currently I have two levels of user in my app. A standard user, which uses a Laravel's built-in database authentication; and an administrative user, which uses LDAP authentication via Adldap2. config/auth.php: ... "guards" => [ "web" => [ …
miken32
  • 42,008
  • 16
  • 111
  • 154
2
votes
3 answers

How do I check User Role before Logging in A user with Spatie's Laravel-Permission?

I'm using Spatie's "Laravel Permission" Package for the ACL. Everything is working perfectly. I now want to allow only the User roles 2 and 3 to Login. Previously, before using "Laravel Permission" package I had only this "role" column on my table…
ask_alab
  • 59
  • 1
  • 1
  • 7
2
votes
2 answers

Allow multiple password reset tokens in Laravel

The default behaviour of Laravel (5.7)'s password reset system is to create a new token in the password_resets table after deleting any others for that user. This behaviour is determined in \Illuminate\Auth\Passwords\DatabaseTokenRepository and it…
miken32
  • 42,008
  • 16
  • 111
  • 154
2
votes
1 answer

Trying Multiple User Auth, it keep saying wrong instance of argument passed

I'm getting this error while trying to log in multiple users with guards and unable to understand what instance it needs to be passed: Argument 1 passed to Illuminate\Auth\EloquentUserProvider::validateCredentials() must be an instance of…
Habib Rehman
  • 590
  • 3
  • 15
  • 36
2
votes
3 answers

Change the default Laravel authentificaton email field to user_email

Laravel error when I change the email field from database to user_email Illuminate\Database\QueryException SQLSTATE[42S22]: Column not found: 1054 Unknown column 'email' in 'where clause' (SQL: select * from ns_users where email =…
2
votes
2 answers

Hash::check in Laravel 5 is not working, always return false?

I use hash check to compare between current password which is inputted by the user and current password which is stored in the database (Bcrypt) Here is my source code $user = User::findOrFail($request->id); if…
Rick_y
  • 83
  • 1
  • 5
2
votes
1 answer

Modify Laravel built-in Auth for users

I am using Laravel built-in Authentication for users which I run from the terminal php artisan make:auth It has one table in the database, users table and has an isAdmin column, so I am assuming it has two roles an admin and not_amin account. Now,…
Emjey23
  • 339
  • 1
  • 4
  • 16
2
votes
2 answers

Laravel 5.6 - How to authenticate API using sessions for same folder SPA?

I have a React SPA in the same Laravel project. The login/signup/logout and all other js views are in the js folder and use axios api calls for all POST/GET requests. I want to use the default Laravel session based web authentication for the…
Wonka
  • 8,244
  • 21
  • 73
  • 121
2
votes
2 answers

laravel/ how to check a permissions in blade and controller?

I create some permissions and roles for my laravel project. in web.php route, I can define a middleware like this with some permissions: $can = ['can:manage_global,manage_users,create_users']; $this->get('/create',…
Areza
  • 671
  • 14
  • 26
2
votes
1 answer

How to Send an Email Verification for a Created User?

I'm trying to use Laravel 5.7's new email verification feature. Let's say I'm logged in as Admin inside the admin panel and I want to: Create a random user via admin panel. Send an email verification to that created user's email. How can I…
rook99
  • 1,034
  • 10
  • 34
1
vote
0 answers

Laravel : Attempt Auth Using API with running the AES_ENCRYPT

I'm having a problem trying to authenticate api with the attemp() function in laravel, because I need to run the AES_ENCRYPT function in mysql to be able to match my post data with the data in the database. this is the code i wrote in the controller…
HALIM
  • 63
  • 8
1
vote
3 answers

Make Laravel Model Authenticatable

I want a different Model the be able to login too. The name of the Model is Client. So this is added this to auth.php config: 'guards' => [ 'web' => [ 'driver' => 'session', 'provider' => 'users', ], 'client' => [ …
user1469734
  • 851
  • 14
  • 50
  • 81
1
vote
1 answer

Laravel 9 with breeze, how to make login user from external JavaScript?

I am trying to build API for login into my Laravel site from an external JavaScript. I used Breeze starter kit for Authentication. In the JavaScript, first it calls an API for getting login_token, then make a request to login with the token. (Yes, I…
Jiwon
  • 366
  • 2
  • 17