go/twitterchiver/viewer: fix authR

This commit is contained in:
Luke Granger-Brown 2021-03-31 23:33:35 +00:00
parent 66bfd9a458
commit 12e595bf43

View file

@ -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) {