getCurrentUserProfile method

CarpUser? getCurrentUserProfile(
  1. OidcUser user
)

Gets the CARP profile of the current user from the JWT token of user. Returns null if the the user don't have an access token.

Implementation

CarpUser? getCurrentUserProfile(OidcUser user) {
  if (user.token.accessToken == null) return null;

  var jwt = JwtDecoder.decode(user.token.accessToken!);
  return CarpUser.fromJWT(jwt, user.token);
}