Skip to content

Commit

Permalink
Makes redirect_uri optional in user service GetToken
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Moran <rmoran@pivotal.io>
  • Loading branch information
Dave Protasowski authored and Ryan Moran committed Aug 10, 2016
1 parent a056729 commit 64a7b25
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion users_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,14 @@ func (us UsersService) ChangePassword(id, oldPassword, password, token string) e
func (us UsersService) GetToken(username, password string, client Client) (string, error) {
query := url.Values{
"client_id": []string{client.ID},
"redirect_uri": client.RedirectURI,
"scope": []string{strings.Join(client.Scope, " ")},
"response_type": []string{"token"},
}

if len(client.RedirectURI) > 0 {
query["redirect_uri"] = client.RedirectURI
}

requestPath := url.URL{
Path: "/oauth/authorize",
RawQuery: query.Encode(),
Expand Down

0 comments on commit 64a7b25

Please sign in to comment.