From 12e595bf438d3852785b316c82081ce6d15e9f22 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Wed, 31 Mar 2021 23:33:35 +0000 Subject: [PATCH] go/twitterchiver/viewer: fix authR --- go/twitterchiver/viewer/viewer.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/go/twitterchiver/viewer/viewer.go b/go/twitterchiver/viewer/viewer.go index 7c85e3cb4c..8a596e0fcc 100644 --- a/go/twitterchiver/viewer/viewer.go +++ b/go/twitterchiver/viewer/viewer.go @@ -154,8 +154,10 @@ func main() { log.Fatalf("pomerium.New: %v", err) } authR.Use(pomerium.AddIdentityToRequest(v)) + log.Println("configured pomerium middleware") + } else { + authR = r } - authR = r userFromContext := func(ctx context.Context) (string, error) { if *localDisableAuth != "" { @@ -165,7 +167,7 @@ func main() { if err != nil { return "", err } - return identity.User, nil + return identity.Email, nil } writeError := func(rw http.ResponseWriter, status int, wrap string, err error) {