Skip to content

Commit

Permalink
fix: create empty oidc provider for test
Browse files Browse the repository at this point in the history
  • Loading branch information
jr0d committed Jun 16, 2020
1 parent 327bb07 commit 4933b31
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package tfa

import (
"fmt"
"github.com/coreos/go-oidc"
"io/ioutil"
"net/http"
"net/http/httptest"
Expand Down Expand Up @@ -72,8 +73,9 @@ func TestServerAuthHandlerInvalid(t *testing.T) {
c.Value = fmt.Sprintf("bad|%s|%s", parts[1], parts[2])

config.AuthHost = ""
config.OIDCProvider = &oidc.Provider{}
res, _ = doHttpRequest(req, c)
assert.Equal(401, res.StatusCode, "invalid cookie should not be authorised")
assert.Equal(302, res.StatusCode, "invalid cookie should redirect")

// Should validate email
req = newDefaultHttpRequest("/foo")
Expand Down

0 comments on commit 4933b31

Please sign in to comment.