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
3
votes
1 answer

Attempt to read property \"view\" on null when sending password reset email

I am trying to build password reset functionality but with a custom email template. So instead of returning the MailMessage from the notification I can sending my own custom mail. Sending the email is working but the problem is in postman I get a…
nikulas13
  • 115
  • 1
  • 8
3
votes
0 answers

Laravel prevent the user from login for 30 seconds after 3 failed login

Using Laravel Passport for authentication and also integrated the hasTooManyLoginAttempts() to prevent too many login attempts. But the problem is I need the specify a 30 seconds delay instead of minutes. protected $maxAttempts = 3; protected…
Manu Joseph
  • 389
  • 4
  • 10
3
votes
2 answers

Laravel Session and Auth clears after redirection from Payment Gateway

I am using Laravel 7 and using PayTabs payment gateway for payments. When the user is redirected back from the Paytabs, all the sessions and Auth are cleared. Before redirecting to the Paytabs, im saving the session when the data is put in the…
3
votes
0 answers

Laravel check if user is deactivated before mail is send

I'm using Laravel Version 7, and in my users' table, I have an additional field called "deactivated" to deactivate a user. However, I don't want a deactivated user to be able to send himself a Password Reset E-Mail via the built-in function. So, how…
q55awr
  • 119
  • 1
  • 10
3
votes
0 answers

Auth is not working in middleware in Laravel

I have successfully loggedin my adminpanel but while I redirect to dashboard after login using middleware it's not working. login controller if (Auth::attempt(['username' => $request->email, 'password' => $request->password])) { return…
3
votes
1 answer

Can I use two guards within one model?

I need to authenticate users in two different ways using one model. Is it possible to define two guards and chose the preferable one e.g. on the controller level? Also maybe there is a better way to implement that using laravel? Would appreciate…
mom__66
  • 53
  • 10
3
votes
1 answer

How can I customize the password field in Laravel HTTP Basic Authentication?

I want to change the password field to user_password in the SQL request when I use the connection HTTP Basic Authentication. The middleware that I use is auth.basic specific to Laravel. I managed to change the username by creating middleware, but I…
diego
  • 408
  • 8
  • 21
3
votes
1 answer

Auth::attempt () in Laravel 5.5 always return false

I use Hash to bcrypt password in my seeder, and in my controller, I use Auth to check request from client, but it always returns false, I don't know why. This is the code: My HomeController: public function login(Request $request) { …
2
votes
1 answer

Laravel 8 custom logout method not working and not logs out the user

I'm working with Laravel 8 and I wanted to build my own logout method like this: public function logout(Request $request) { $this->guard()->logout(); $request->session()->invalidate(); …
japose7523
  • 29
  • 2
  • 15
2
votes
2 answers

Laravel 9 - How to prevent showing login page after user is logged-in and hit browser back button

How can I ensure that as soon as the user is logged-in in Laravel-9 he can no longer go to the login page via browser back button? I searched the internet for solutions. I have read in several places that it is not possible or that I have to use…
Mohsen
  • 260
  • 3
  • 14
2
votes
0 answers

Laravel authentication by session, different domains, same application

In my new Project, I need to create an authentication system, the requirements are: authentication should be done for different domains and sub-domains for now, the only client type is front-end applications(SPA) site A can have two domains,…
2
votes
0 answers

Laravel 9, Sanctum - Authenticate using a separate table for user, email & password

I've got 3 tables for Laravel authentication. UserMeta, UserEmail and UserPassword. We've set it up this way so users can add multiple emails to their account, we can track password changes (&revert if necessary). This obviously makes authentication…
XLR
  • 199
  • 3
  • 17
2
votes
0 answers

Best approach for using external API for authorization with Laravel Auth scaffolding

I need to use an external API to authorize users of my Laravel app. I would like to use most of Laravel's auth scaffolding. Ideally I would not use a local database, but I'm flexible. I'm aware of a few different approaches - using custom…
2
votes
1 answer

Expected response code 250 but got code "554", with message "554 Message rejected | Laravel Using TO Email

Laravel Version: 8.27 PHP Version $ php --version: PHP 8.0.3 (cli) Database Driver & Version $ mysql --version: mysql Ver 8.0.23-0ubuntu0.20.04.1 Problem Statement: I'm getting TO email in FROM email which of course will not be verified in…
Maqsud
  • 739
  • 3
  • 12
  • 35
2
votes
1 answer

laravel formrequest before middleware

I know, this is a complex case but maybe one of you might have an idea on how to do this. Concept I have the following process in my API: Process query string parameters (FormRequest) Replace key aliases by preferred keys Map string parameters to…
1 2
3
25 26