Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

201
Vistas
Laravel | ask password for certain actions

I have a form in my Laravel project. And when a user tries to submit this form I want to show a dialog asking their password(for additional security). i.e I want the logged in user to enter his/her password when he/she wants to do some critical actions and verify that password.

I can figure out the front-end part of this but I don't know how to implement the controller logic for the same.

From documentation I found Auth::check() but it only checks if the current user is logged in or not.

How should I go about doing this?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

You can ask logged in user for a password and then check it manually with check() method, for example:

if (Hash::check(request('password'), auth()->user()->password))

The first argument is a password entered by a user. The second argument is hashed password from DB.

over 4 years ago · Santiago Trujillo Denunciar

0

I am actually planning to implement this on one of my websites. Lately, I have been going thought the planning and this is what I came through with:

  1. When user comes to the app, he/she logs in
  2. He/she adds some of the item to cart. The user has been already auth-ed, so this is not issue.
  3. When he/she tries to checkout, check for existence of very specific session item (e.g. REAUTH_SUCCESS) and if such existed, proceed. Otherwise, go back and print login form with password field alone. After this, it is just matter of doing what @Alexey and @Robert suggested in their answers.

Hope this helps.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda