Projekt

Obecné

Profil

« Předchozí | Další » 

Revize f0fde45c

Přidáno uživatelem Vojtěch Bartička před asi 2 roky(ů)

Authentication controller now returns user role

Zobrazit rozdíly:

Backend/Core/Services/AuthService/AuthService.cs
28 28
        var expiration = DateTime.Now.AddHours(12);
29 29
        var token = jwtUtils.GenerateJwtToken(user, expiration);
30 30

  
31
        var loginResult = new LoginResponse(true, token, expiration);
31
        var loginResult = new LoginResponse(true, token, expiration, user.Role);
32 32

  
33 33
        return loginResult;
34 34
    }
Backend/Models/Authentication/LoginResponse.cs
4 4

  
5 5
public class LoginResponse
6 6
{
7
    public LoginResponse(bool ok, string token, DateTime expiration)
7
    public LoginResponse(bool ok, string token, DateTime expiration, ERole role)
8 8
    {
9 9
        Ok = ok;
10 10
        Token = token;
11 11
        Expiration = expiration;
12
        Role = role;
12 13
    }
13 14

  
14 15
    public LoginResponse()

Také k dispozici: Unified diff