Skip to content

Commit

Permalink
Specify Provider instead of RefreshUrl
Browse files Browse the repository at this point in the history
This way the RefreshUrl's are kept central at the config
and keeps them a bit more DRY.
  • Loading branch information
leostera committed Apr 7, 2015
1 parent 288a921 commit d7a8997
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/imap.erl
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
-type auth_plain() :: {plain, Username :: binary(), Password :: binary()}.
-type auth_xoauth2() :: {xoauth2, Account :: binary(),
AccessToken :: binary() |
{RefreshToken :: binary(), RefreshUrl :: binary()}}.
{RefreshToken :: binary(), Provider :: binary()}}.
-type auth() :: auth_plain() | auth_xoauth2().

%% opt() specifies an option that the imap process can be started with -- see start_link
Expand Down Expand Up @@ -453,10 +453,10 @@ auth_to_props({xoauth2, Username, Token}) ->
AccessToken when is_binary(Token) ->
[{<<"type">>, <<"access">>},
{<<"token">>, AccessToken}];
{RefreshToken, RefreshUrl} ->
{RefreshToken, Provider} ->
[{<<"type">>, <<"refresh">>},
{<<"token">>, RefreshToken},
{<<"url">>, RefreshUrl}]
{<<"provider">>, Provider}]
end
}].

Expand Down

0 comments on commit d7a8997

Please sign in to comment.