Skip to content

Instantly share code, notes, and snippets.

@blatyo
Created December 3, 2016 19:23
Show Gist options
  • Save blatyo/ccc19273ebf86d8a874b6b448cbd3fb7 to your computer and use it in GitHub Desktop.
Save blatyo/ccc19273ebf86d8a874b6b448cbd3fb7 to your computer and use it in GitHub Desktop.
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