~bigbes/core-go

c3d1199173842d1063aff2c1eb8a6689673ba883 — Drew DeVault 1 year, 6 months ago e4b0261
webhooks: fix filter for internal auth
1 files changed, 6 insertions(+), 1 deletions(-)

M webhooks/config.go
M webhooks/config.go => webhooks/config.go +6 -1
@@ 72,7 72,12 @@ func FilterWebhooks(ctx context.Context) (sq.Sqlizer, error) {
	if err != nil {
		return nil, err
	}
	if ac.ClientID != nil {
	if ac.AuthMethod == auth.AUTH_INTERNAL {
		return sq.And{
			sq.Expr(`user_id = ?`, user.UserID),
			sq.Expr(`auth_method = 'INTERNAL'`),
		}, nil
	} else if ac.ClientID != nil {
		// XXX: Should we maybe return all webhooks configured by client ID?
		return sq.And{
			sq.Expr(`NOW() at time zone 'utc' < expires`),