summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2023-09-27 16:41:48 +0200
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2023-09-29 13:31:43 +0200
commitcf7935585c2176a164883224dbf2aa5904637a29 (patch)
treeda1393d14e7bc76c93683760c60fbd507d0ad860
parent9af1abef900dc4100b0ac0b757a4afa73cd22583 (diff)
OAuth Test: Fix redirect URI + listener changes
-rw-r--r--internal/oauth/oauth_test.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/internal/oauth/oauth_test.go b/internal/oauth/oauth_test.go
index 4818f42..1181b5d 100644
--- a/internal/oauth/oauth_test.go
+++ b/internal/oauth/oauth_test.go
@@ -3,7 +3,6 @@ package oauth
import (
"context"
"encoding/json"
- "fmt"
"net/url"
"strings"
"testing"
@@ -169,7 +168,7 @@ func Test_AuthURL(t *testing.T) {
s, err := o.AuthURL(id, func(s string) string {
// We do nothing here are this function is for skipping WAYF
return s
- })
+ }, "")
if err != nil {
t.Fatalf("Error in getting OAuth URL: %v", err)
}
@@ -196,11 +195,6 @@ func Test_AuthURL(t *testing.T) {
t.Fatalf("Returned Auth URL cannot be parsed with error: %v", err)
}
- port, err := o.ListenerPort()
- if err != nil {
- t.Fatalf("Listener port cannot be found with error: %v", err)
- }
-
c := []struct {
query string
want string
@@ -209,7 +203,7 @@ func Test_AuthURL(t *testing.T) {
{query: "code_challenge_method", want: "S256"},
{query: "response_type", want: "code"},
{query: "scope", want: "config"},
- {query: "redirect_uri", want: fmt.Sprintf("http://127.0.0.1:%d/callback", port)},
+ {query: "redirect_uri", want: o.session.RedirectURI},
}
q := u.Query()