mirror of https://github.com/artifacthub/hub.git
Fix user alias availability check (#832)
Related to #831 Signed-off-by: Sergio Castaño Arteaga <tegioz@icloud.com>
This commit is contained in:
parent
40ce3f423f
commit
98d2f75f98
|
|
@ -18,7 +18,13 @@ import (
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// Database queries
|
// Database queries
|
||||||
checkUserAliasAvailDBQ = `select user_id from "user" where alias = $1`
|
checkUserAliasAvailDBQ = `
|
||||||
|
select user_id
|
||||||
|
from "user" u
|
||||||
|
join email_verification_code c using (user_id)
|
||||||
|
where u.alias = $1
|
||||||
|
and current_timestamp - '1 day'::interval < c.created_at
|
||||||
|
`
|
||||||
checkUserCredsDBQ = `select user_id, password from "user" where email = $1 and password is not null and email_verified = true`
|
checkUserCredsDBQ = `select user_id, password from "user" where email = $1 and password is not null and email_verified = true`
|
||||||
deleteSessionDBQ = `delete from session where session_id = $1`
|
deleteSessionDBQ = `delete from session where session_id = $1`
|
||||||
getAPIKeyUserIDDBQ = `select user_id from api_key where key = $1`
|
getAPIKeyUserIDDBQ = `select user_id from api_key where key = $1`
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue