mirror of
https://github.com/zitadel/zitadel.git
synced 2025-06-12 11:58:38 +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) }()
|
defer func() { span.EndWithError(err) }()
|
||||||
|
|
||||||
stmt, scan := prepareAppQuery()
|
stmt, scan := prepareAppQuery()
|
||||||
var eq []sq.Sqlizer
|
eq := sq.Eq{AppColumnInstanceID.identifier(): authz.GetInstance(ctx).InstanceID()}
|
||||||
eq = append(eq, sq.And{
|
if !withOwnerRemoved {
|
||||||
sq.Eq{AppColumnInstanceID.identifier(): authz.GetInstance(ctx).InstanceID()},
|
eq[AppColumnOwnerRemoved.identifier()] = false
|
||||||
|
}
|
||||||
|
query, args, err := stmt.Where(sq.And{
|
||||||
|
eq,
|
||||||
sq.Or{
|
sq.Or{
|
||||||
sq.Eq{AppOIDCConfigColumnClientID.identifier(): clientID},
|
sq.Eq{AppOIDCConfigColumnClientID.identifier(): clientID},
|
||||||
sq.Eq{AppAPIConfigColumnClientID.identifier(): clientID},
|
sq.Eq{AppAPIConfigColumnClientID.identifier(): clientID},
|
||||||
},
|
},
|
||||||
})
|
}).ToSql()
|
||||||
if !withOwnerRemoved {
|
|
||||||
eq = append(eq, sq.Eq{AppColumnOwnerRemoved.identifier(): false})
|
|
||||||
}
|
|
||||||
query, args, err := stmt.Where(eq).ToSql()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.ThrowInternal(err, "QUERY-Dfge2", "Errors.Query.SQLStatement")
|
return nil, errors.ThrowInternal(err, "QUERY-Dfge2", "Errors.Query.SQLStatement")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user