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
7
votes
7 answers

Prevent logout after updating user password in Laravel 5.5

Beginning with Laravel 5.3, this middleware was added... \Illuminate\Session\Middleware\AuthenticateSession While it's definitely a benefit for security purposes, it's also responsible for logging the user out (presenting the user with the login…
6
votes
3 answers

Login with either email or username with Fortify Laravel 8

I'm trying to allow users to login using either email or username along with their password. I've added the following code inside boot() in FortifyServiceProvider.php : Fortify::authenticateUsing(function (Request $request) { $user =…
Bu Saeed
  • 1,173
  • 1
  • 16
  • 27
6
votes
2 answers

How to use laravel fortify for authentication in multiple places on the same website

When using laravel/UI we can create authentication scaffold on multiple places or for multiple users like admin, normal users by copy-pasting the same scaffold generated by the &--auth flag. How can we achieve the same with Fortify? How can we use…
Ajith Lal
  • 83
  • 2
  • 9
6
votes
2 answers

Argument 1 passed to App\Http\Controllers\Auth\LoginController::attemptLogin() must be an instance of App\Http\Controllers\Auth\Request

I am adding 1 attribute for authentication, but it doesn't work. i'm not change anything except adding this 2 method in my LoginController protected function credentials(Request $request) { return $request->only($this->username(),…
5
votes
1 answer

Login auth with 2 different tables

I have the laravel 8 auth login form working perfectly, but i need to create a new athentication system for a different kind of users that are being stored in the database in another table with their own username and password. how can i achieve…
elgranchuchu
  • 333
  • 1
  • 5
  • 18
5
votes
3 answers

Changing email column name in laravel 5.6 in default users table

I have my own users table which I want to use in auth, but the problem is the email field is "userEmail" instead of "email". For login page I overided the below method in LoginController.php public function username() { return…
Asif Rao
  • 199
  • 2
  • 15
4
votes
1 answer

Laravel login - After the login is successful, it does not remain and returns to the login page

I tried several ways to login, the one that works is Auth::login($user);, but he doesn't stay logged in, he goes back to the login page. Login Controller: public function validateCode(Request $request) { $email = $request->email; …
Gabriel Edu
  • 628
  • 3
  • 11
4
votes
5 answers

Laravel Fortify doesn't respond with HTTP code but with actual routes, even if I send the registration request as an XHR one

Context With Postman, I send the following fields in order to register a user in the db, to the URL http://mywebsite/register: email password password_confirmation name According to the documentation…
4
votes
0 answers

How to customize login error messages in Fortify Laravel 8

When users enter wrong username or password they get the following message: These credentials do not match our records. How can I change this message to something like: You have entered an invalid username/password or both. Please try again. I…
Bu Saeed
  • 1,173
  • 1
  • 16
  • 27
4
votes
1 answer

Laravel 8 Fortify User UUID Login Problem

I am currently setting up a new project using Laravel 8. Out of the box, Laravel is configured to use auto-incrementing ID's for the user's ID. In the past I have overrode this by doing the following. Updating the ID column in the user table…
Abu
  • 186
  • 6
4
votes
1 answer

Laravel 7 multi auth with 3 different tables

I'm new to Laravel 7 and i'm creating an application that requires 3 different user tables ( Admin , salesperson, warehouse manager ) Each user can login from a separate login form and has a different dashboard. I want to implement authentication…
zineb
  • 51
  • 1
  • 6
4
votes
2 answers

How to authenticate user without a DB in Laravel?

I created a new project in Laravel that consumes all data from an API. For private data like a user profile, I need an access token to get the data. Once I have an access token, how do I set the token as Auth::id() in Laravel? Or perhaps I can store…
naticap
  • 379
  • 1
  • 5
  • 19
4
votes
2 answers

Laravel Authentication - Email in different table

I have two tables: persons: id name email phone person_type_id users id person_id password role_id etc... Could you please tell me how to make Laravel's (5.8) built in Authentication System use the email field from persons table when…
black_belt
  • 6,601
  • 36
  • 121
  • 185
4
votes
1 answer

How to override default login mechanism of Laravel 5.6?

I want the user to login only if status field in users table is set to 1. If it is 0 then simply return error stating user account is not active. So after creating the status field in the table, where can I make the check that the user'status is 1…
Raj
  • 1,928
  • 3
  • 29
  • 53
3
votes
5 answers

how to change redirect after auth Email verification in laravel 8?

I have 2 condition after successful registration with email verification. If the new user is select plan from home page, redirects to registration page submits the form. then will get Email verfication link, and after email verified I want to…
1
2
3
25 26