checkAuthToken :: Key -> AuthToken -> Maybe String
checkAuthToken key (AuthToken email session) =
  case decrypt key $ pack session of
    Nothing -> Nothing
    Just str -> if str == pack email then Just email
                                     else Nothing
checkAuthToken :: Key -> AuthToken -> Maybe String
checkAuthToken key (AuthToken email session) =
  case decrypt key $ pack session of
    Nothing -> Nothing
    Just str -> if str == pack email then Just email
                                     else Nothing
checkAuthToken key (AuthToken email session) =
  case decrypt key $ pack session of
    Nothing -> Nothing
    Just str -> if str == pack email then Just email
                                     else Nothing