angular springboot login JWT

Discussão em 'Angular' iniciado por user29415755, Janeiro 29, 2025.

  1. user29415755

    user29415755 Guest

    after login i stored token and userRole in localStorage..i tried to inject a random token(without login) in localStorage via navigator and then, i can get access to restricted page...

    i want to prevent this security issue..i thinked about a database that i store my token directly after the login and then compared with the one exist in localStorage.

    `isAuthenticated():boolean{

    const token = localStorage.getItem('token');

    return !!token;


    }`

    Continue reading...

Compartilhe esta Página