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:
patrick brisbin 2014-09-13 16:45:36 -04:00
parent 3b2aeed871
commit eb5f9488f8
No known key found for this signature in database
GPG Key ID: DB04E2CE780A17DE

View File

@ -90,7 +90,7 @@ oauth2GithubScoped clientId clientSecret scopes = basicPlugin {apDispatch = disp
dispatch "GET" ["callback"] = do
state <- lift $ runInputGet $ ireq textField "state"
savedState <- lookupSession "githubState"
apDispatch basicPlugin "GET" ["callback"]
_ <- apDispatch basicPlugin "GET" ["callback"]
case savedState of
Just saved | saved == state -> apDispatch basicPlugin "GET" ["callback"]
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"
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
(Left err, _) -> throwIO $ InvalidProfileResponse "github" err
(_, Left err) -> throwIO $ InvalidProfileResponse "github" err