Created
December 3, 2016 19:23
-
-
Save blatyo/ccc19273ebf86d8a874b6b448cbd3fb7 to your computer and use it in GitHub Desktop.
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
defmodule LoginService do | |
def call(attrs) do | |
with {:ok, profile_id} <- login_with_auth(attrs), | |
{:ok, user} <- lookup_user(profile_id) do | |
send_user_refresh_request(user) | |
{:ok, %Authentication{id: user.id, user: user}} | |
else | |
error -> error | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment