Skip to content

Commit

Permalink
updating readinglist for oauth to work
Browse files Browse the repository at this point in the history
  • Loading branch information
jprobinson committed Dec 7, 2017
1 parent 0c1657e commit b646247
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/reading-list/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ func (s service) HTTPMiddleware(h http.Handler) http.Handler {
// injecting the current user into the request context.
func (s service) Middleware(ep endpoint.Endpoint) endpoint.Endpoint {
return endpoint.Endpoint(func(ctx context.Context, r interface{}) (interface{}, error) {
usr, err := user.CurrentOAuth(ctx, "https://www.googleapis.com/auth/userinfo.profile")
usr, err := user.CurrentOAuth(ctx,
"https://www.googleapis.com/auth/userinfo.profile",
"https://www.googleapis.com/auth/userinfo.email",
)
if usr == nil || err != nil {
// reject if user is not logged in
return nil, marvin.NewProtoStatusResponse(
Expand Down

0 comments on commit b646247

Please sign in to comment.