Fix handling Keycloak users without family/given name set

This commit is contained in:
Filip Gralinski 2021-09-25 13:12:05 +02:00
parent e819617c38
commit dcd30b6ccd

View File

@ -21,8 +21,8 @@ data JwtAuthInfo = JwtAuthInfo {
instance FromJSON JwtAuthInfo where instance FromJSON JwtAuthInfo where
parseJSON (Object v) = parseJSON (Object v) =
JwtAuthInfo <$> v .: "preferred_username" JwtAuthInfo <$> v .: "preferred_username"
<*> v .: "family_name" <*> v .:? "family_name"
<*> v .: "given_name" <*> v .:? "given_name"
parseJSON _ = mzero parseJSON _ = mzero
jwtAuthInfoIdent :: JwtAuthInfo -> Text jwtAuthInfoIdent :: JwtAuthInfo -> Text