jwt implementation and login, not working yet

This commit is contained in:
filipriec
2025-03-25 10:15:17 +01:00
parent 9393294af8
commit cd32c175a4
12 changed files with 318 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ import "common.proto";
service AuthService {
rpc Register(RegisterRequest) returns (AuthResponse);
rpc Login(LoginRequest) returns (LoginResponse);
}
message RegisterRequest {
@@ -21,3 +22,16 @@ message AuthResponse {
string email = 3; // Registered email (if provided)
string role = 4; // Default role: 'accountant'
}
message LoginRequest {
string identifier = 1; // Can be username or email
string password = 2;
}
message LoginResponse {
string access_token = 1; // JWT token
string token_type = 2; // Usually "Bearer"
int32 expires_in = 3; // Expiration in seconds (86400 for 24 hours)
string user_id = 4; // User's UUID in string format
string role = 5; // User's role
}