diff --git a/internal/service/handlers/daily_question_check.go b/internal/service/handlers/daily_question_check.go index 7e47662..cd700d3 100644 --- a/internal/service/handlers/daily_question_check.go +++ b/internal/service/handlers/daily_question_check.go @@ -29,7 +29,7 @@ func CheckDailyQuestion(w http.ResponseWriter, r *http.Request) { option := req.Data.Attributes.Answer dq := DailyQuestions(r) - if !auth.Authenticates(UserClaims(r), auth.VerifiedGrant(nullifier)) { + if !auth.Authenticates(UserClaims(r), auth.UserGrant(nullifier)) { ape.RenderErr(w, problems.Unauthorized()) return } diff --git a/internal/service/handlers/daily_question_get.go b/internal/service/handlers/daily_question_get.go index d873c61..4de5fa7 100644 --- a/internal/service/handlers/daily_question_get.go +++ b/internal/service/handlers/daily_question_get.go @@ -19,7 +19,7 @@ func GetDailyQuestion(w http.ResponseWriter, r *http.Request) { nullifier := strings.ToLower(chi.URLParam(r, "nullifier")) dq := DailyQuestions(r) - if !auth.Authenticates(UserClaims(r), auth.VerifiedGrant(nullifier)) { + if !auth.Authenticates(UserClaims(r), auth.UserGrant(nullifier)) { ape.RenderErr(w, problems.Unauthorized()) return } diff --git a/internal/service/handlers/daily_questions_status.go b/internal/service/handlers/daily_questions_status.go index 8989bff..f81d0ef 100644 --- a/internal/service/handlers/daily_questions_status.go +++ b/internal/service/handlers/daily_questions_status.go @@ -16,7 +16,7 @@ import ( func GetDailyQuestionsStatus(w http.ResponseWriter, r *http.Request) { nullifier := strings.ToLower(chi.URLParam(r, "nullifier")) - if !auth.Authenticates(UserClaims(r), auth.VerifiedGrant(nullifier)) { + if !auth.Authenticates(UserClaims(r), auth.UserGrant(nullifier)) { ape.RenderErr(w, problems.Unauthorized()) return } diff --git a/internal/service/handlers/fulfill_poll_event.go b/internal/service/handlers/fulfill_poll_event.go index adbb597..b2bc0f4 100644 --- a/internal/service/handlers/fulfill_poll_event.go +++ b/internal/service/handlers/fulfill_poll_event.go @@ -38,7 +38,7 @@ func FulfillPollEvent(w http.ResponseWriter, r *http.Request) { "proposal_event_id": proposalEventID, }) - if !auth.Authenticates(UserClaims(r), auth.VerifiedGrant(nullifier)) || + if !auth.Authenticates(UserClaims(r), auth.UserGrant(nullifier)) || new(big.Int).SetBytes(hexutil.MustDecode(nullifier)).String() != proof.PubSignals[config.PollChallengedNullifier] { log.Debug("failed to authenticate user") ape.RenderErr(w, problems.Unauthorized())