fix some security issues
This commit is contained in:
@@ -40,13 +40,13 @@ func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) error {
|
||||
return err
|
||||
}
|
||||
|
||||
const getUserByAPIKey = `-- name: GetUserByAPIKey :one
|
||||
const getUser = `-- name: GetUser :one
|
||||
|
||||
SELECT id, created_at, updated_at, name, api_key FROM users WHERE api_key = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetUserByAPIKey(ctx context.Context, apiKey string) (User, error) {
|
||||
row := q.db.QueryRowContext(ctx, getUserByAPIKey, apiKey)
|
||||
func (q *Queries) GetUser(ctx context.Context, apiKey string) (User, error) {
|
||||
row := q.db.QueryRowContext(ctx, getUser, apiKey)
|
||||
var i User
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
|
||||
Reference in New Issue
Block a user