AuthUser.fromJson constructor
AuthUser.fromJson(
- Map<String, dynamic> json
)
Implementation
AuthUser.fromJson(Map<String, dynamic> json) {
var claims = Map.of(json);
sub = claims.remove('sub');
scopes = (claims.remove('scopes') as List<dynamic>).cast<String>();
userId = claims.remove('userId');
firstName = claims.remove('firstName');
lastName = claims.remove('lastName');
enabled = claims.remove('enabled');
tenantId = claims.remove('tenantId');
customerId = claims.remove('customerId');
isPublic = claims.remove('isPublic');
authority = scopes.isNotEmpty
? authorityFromString(scopes[0])
: Authority.ANONYMOUS;
additionalData = claims;
}