loginUser :: SignInData -> ApiResponse InternalUser
loginUser (encPass, Just user@(InternalUser _ _ pass _), newApiKey)
    | verified = success $ user { iApiKey = newApiKey }
    | otherwise = failure AuthError
    where verified = verifyPass'
              (Pass $ B.toStrict pass)
              (EncryptedPass $ B.toStrict encPass)
loginUser :: SignInData -> ApiResponse InternalUser
loginUser (encPass, Just user@(InternalUser _ _ pass _), newApiKey)
    | verified = success $ user { iApiKey = newApiKey }
    | otherwise = failure AuthError
    where verified = verifyPass'
              (Pass $ B.toStrict pass)
              (EncryptedPass $ B.toStrict encPass)
loginUser (encPass, Just user@(InternalUser _ _ pass _), newApiKey)
    | verified = success $ user { iApiKey = newApiKey }
    | otherwise = failure AuthError
    where verified = verifyPass'
              (Pass $ B.toStrict pass)
              (EncryptedPass $ B.toStrict encPass)