2026-03-16 18:06:59 +03:00

35 lines
732 B
Go

package commandEmailPassToOidc
const (
allUsersQuery = `
SELECT
users.id,
users.username,
users.password,
users.authdata,
users.authservice,
users.email,
users.emailverified,
users.nickname,
users.firstname,
users.lastname,
users.roles
FROM users
LEFT JOIN bots ON users.id = bots.userid
WHERE users.deleteat = 0
AND bots.userid IS NULL
AND roles LIKE '%system_user%'
AND roles NOT LIKE '%system_admin%'
AND (users.authservice != 'openid' OR users.authservice IS NULL)
`
changeLoginQuery = `
UPDATE users
SET password = '',
authdata = $2,
emailverified = $3,
authservice = 'openid'
WHERE id = $1
`
)