Created
January 11, 2019 20:16
-
-
Save gigobyte/be13ba03b9873ecaba45e9bd8334eab9 to your computer and use it in GitHub Desktop.
Infix vs do notation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
headerToUsername :: Text -> Maybe Text | |
headerToUsername authHeader = do | |
JWT.stringOrURIToText <$> (JWT.sub =<< JWT.claims <$> JWT.decode authHeader) | |
headerToUsernameDo :: Text -> Maybe Text | |
headerToUsernameDo authHeader = do | |
unverifiedJwt <- JWT.decode authHeader | |
subject <- JWT.sub $ JWT.claims unverifiedJwt | |
return $ JWT.stringOrURIToText subject |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment