helper functions to handle authenticated users.
The user type to store the user information
pub type User {
User(name: String, claims: List(#(String, String)))
}
Constructors
-
User(name: String, claims: List(#(String, String)))
pub fn get_claim(user_option: Option(User), claim_key: String) -> Result(
String,
Nil,
)
Returns the value of a claim.
Either a Ok with the value or Error(Nil) if the
key is not found within the claims.