mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-04 23:45:07 +00:00
fix: correct where statement for AppByOIDCClientID (#4815)
Co-authored-by: Silvan <silvan.reusser@gmail.com>
This commit is contained in:
parent
e7137dba60
commit
add232d1dd
@ -429,18 +429,17 @@ func (q *Queries) AppByClientID(ctx context.Context, clientID string, withOwnerR
|
||||
defer func() { span.EndWithError(err) }()
|
||||
|
||||
stmt, scan := prepareAppQuery()
|
||||
var eq []sq.Sqlizer
|
||||
eq = append(eq, sq.And{
|
||||
sq.Eq{AppColumnInstanceID.identifier(): authz.GetInstance(ctx).InstanceID()},
|
||||
eq := sq.Eq{AppColumnInstanceID.identifier(): authz.GetInstance(ctx).InstanceID()}
|
||||
if !withOwnerRemoved {
|
||||
eq[AppColumnOwnerRemoved.identifier()] = false
|
||||
}
|
||||
query, args, err := stmt.Where(sq.And{
|
||||
eq,
|
||||
sq.Or{
|
||||
sq.Eq{AppOIDCConfigColumnClientID.identifier(): clientID},
|
||||
sq.Eq{AppAPIConfigColumnClientID.identifier(): clientID},
|
||||
},
|
||||
})
|
||||
if !withOwnerRemoved {
|
||||
eq = append(eq, sq.Eq{AppColumnOwnerRemoved.identifier(): false})
|
||||
}
|
||||
query, args, err := stmt.Where(eq).ToSql()
|
||||
}).ToSql()
|
||||
if err != nil {
|
||||
return nil, errors.ThrowInternal(err, "QUERY-Dfge2", "Errors.Query.SQLStatement")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user