Skip to content

Commit

Permalink
fix: check self-service flag in token middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Cihelka committed May 25, 2023
1 parent d2ec999 commit a561b72
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/selfservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ func selfServiceTokenMiddleware(dldm *core.DeltaDM) echo.MiddlewareFunc {
if p.ActorID == "" {
return c.String(401, "invalid provider self-service token")
}
if !p.AllowSelfService {
return c.String(401, "provider is not allowed to self-serve, please contact administrator to enable it")
}

c.Set(PROVIDER, p)

Expand Down

0 comments on commit a561b72

Please sign in to comment.