mirror of
https://github.com/freckle/yesod-auth-oauth2.git
synced 2026-04-27 21:27:54 +02:00
Address compiler warnings
- user was defined by never used in the no mails case - The result of apDispatch is discarded
This commit is contained in:
parent
3b2aeed871
commit
eb5f9488f8
@ -90,7 +90,7 @@ oauth2GithubScoped clientId clientSecret scopes = basicPlugin {apDispatch = disp
|
|||||||
dispatch "GET" ["callback"] = do
|
dispatch "GET" ["callback"] = do
|
||||||
state <- lift $ runInputGet $ ireq textField "state"
|
state <- lift $ runInputGet $ ireq textField "state"
|
||||||
savedState <- lookupSession "githubState"
|
savedState <- lookupSession "githubState"
|
||||||
apDispatch basicPlugin "GET" ["callback"]
|
_ <- apDispatch basicPlugin "GET" ["callback"]
|
||||||
case savedState of
|
case savedState of
|
||||||
Just saved | saved == state -> apDispatch basicPlugin "GET" ["callback"]
|
Just saved | saved == state -> apDispatch basicPlugin "GET" ["callback"]
|
||||||
Just saved -> invalidArgs ["state: " `mappend` state `mappend` ", and not: " `mappend` saved]
|
Just saved -> invalidArgs ["state: " `mappend` state `mappend` ", and not: " `mappend` saved]
|
||||||
@ -104,7 +104,7 @@ fetchGithubProfile manager token = do
|
|||||||
mailResult <- authGetJSON manager token "https://api.github.com/user/emails"
|
mailResult <- authGetJSON manager token "https://api.github.com/user/emails"
|
||||||
|
|
||||||
case (userResult, mailResult) of
|
case (userResult, mailResult) of
|
||||||
(Right user, Right []) -> throwIO $ InvalidProfileResponse "github" "no mail address for user"
|
(Right _, Right []) -> throwIO $ InvalidProfileResponse "github" "no mail address for user"
|
||||||
(Right user, Right mails) -> return $ toCreds user mails token
|
(Right user, Right mails) -> return $ toCreds user mails token
|
||||||
(Left err, _) -> throwIO $ InvalidProfileResponse "github" err
|
(Left err, _) -> throwIO $ InvalidProfileResponse "github" err
|
||||||
(_, Left err) -> throwIO $ InvalidProfileResponse "github" err
|
(_, Left err) -> throwIO $ InvalidProfileResponse "github" err
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user