Skip to content

Commit

Permalink
fix(oauth): parseCode return empty string, instead of value (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
SweetCapitan authored Mar 7, 2024
1 parent c444552 commit 239a35a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/oauth/group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func TestAuthCodeFlowGroup_Token(t *testing.T) {
}

// f("https://oauth.vk.com/blank.html#;", "invalid semicolon separator in query")
f("https://oauth.vk.com/blank.html#error=invalid_request&error_description=Invalid+display+parameter", "oauth: Invalid display parameter")
f("https://oauth.vk.com/blank.html?error=invalid_request&error_description=Invalid+display+parameter", "oauth: Invalid display parameter")
}

func TestImplicitFlowGroup(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/oauth/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const (
)

func parseCode(u *url.URL) (string, error) {
v, err := url.ParseQuery(u.Fragment)
v, err := url.ParseQuery(u.RawQuery)

if errType := v.Get("error"); errType != "" {
err = &Error{
Expand Down
2 changes: 1 addition & 1 deletion api/oauth/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func TestAuthCodeFlowUser_Token(t *testing.T) {
}

// f("https://oauth.vk.com/blank.html#;", "invalid semicolon separator in query")
f("https://oauth.vk.com/blank.html#error=invalid_request&error_description=Invalid+display+parameter", "oauth: Invalid display parameter")
f("https://oauth.vk.com/blank.html?error=invalid_request&error_description=Invalid+display+parameter", "oauth: Invalid display parameter")
}

func TestImplicitFlowUser(t *testing.T) {
Expand Down

0 comments on commit 239a35a

Please sign in to comment.