Aller au contenu (Pressez Entrée)

POPESCU Daniel – Portfolio

  • Accueil
  • Articles
  • Portfolio
  • Mon CV

    Retrouver mes compétences et mon cv

BackEndLaravelPHP

2fa Authenticator sur Laravel (SMS&Email)

/

La sécurité de l’application s’améliore avec la 2FA. Configurer des notifications de mot de passe à usage unique (OTP) par e-mail ou SMS devient très important. Ajouter facilement votre application à Google Authenticator ou Microsoft Authenticator.

app_auth_phone

app_auth_phone
Image 1 parmi 3

2fa Authentification sur mobile

La sécurité de l’application s’améliore avec la 2FA. Configurer des notifications de mot de passe à usage unique (OTP) par e-mail ou SMS devient très important. Ajouter facilement votre apllication à Google Authenticator ou Microsoft Authenticator.

app_auth_phone
enable-2fa-using-qr-scan-1182x628
printscreen1

class User extends Authenticatable
{
    protected $fillable = [
        'name',
        'email',
        'password',
        'two_factor_code', // [tl! add]
        'two_factor_expires_at', // [tl! add]
    ];
    // ...

public function generateTwoFactorCode(): void
{
    $this->timestamps = false;  // Prevent updating the 'updated_at' column
    $this->two_factor_code = rand(100000, 999999);  // Generate a random code
    $this->two_factor_expires_at = now()->addMinutes(10);  // Set expiration time
    $this->save();
}

Projets similaires

Next Js ECommerce, PostgreSQL, Prisma, PayPal, Stripe

20 février 2025

Applications pour les Pharmacies – Stock, Avis, Bilan Santé

6 décembre 2024

Next JS, Hebergement sur Vercel, Home Linux PC

19 décembre 2024

Contact

Vous trouverez mes coordonnées ici.

Dernières articles

  • GitHub OAuth
    APIBackendNextJSReactTailwind

    NextJS Auth & Github OAuth app

  • APIBackendLaravelReact

    App Point de Vente – Laravel+React

  • APIBackendReact

    Simple application pour les cryptomonnaies

© Copyright 2026 POPESCU Daniel - Portfolio. Perfect Portfolio | Développé par Rara Theme. Propulsé par WordPress.