implement delete session
This commit is contained in:
@@ -342,6 +342,16 @@ func (q *Queries) DeleteRedirectURI(ctx context.Context, arg DeleteRedirectURIPa
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const deleteSession = `-- name: DeleteSession :exec
|
||||||
|
DELETE FROM sessions
|
||||||
|
WHERE id = ?
|
||||||
|
`
|
||||||
|
|
||||||
|
func (q *Queries) DeleteSession(ctx context.Context, id string) error {
|
||||||
|
_, err := q.db.ExecContext(ctx, deleteSession, id)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
const getAuthorizationCode = `-- name: GetAuthorizationCode :one
|
const getAuthorizationCode = `-- name: GetAuthorizationCode :one
|
||||||
SELECT id, code, code_challenge, code_challenge_method, user_id, client_id, scope, redirect_uri, created_at, expires_at, used_at
|
SELECT id, code, code_challenge, code_challenge_method, user_id, client_id, scope, redirect_uri, created_at, expires_at, used_at
|
||||||
FROM authorization_codes
|
FROM authorization_codes
|
||||||
|
|||||||
@@ -226,6 +226,10 @@ WHERE id = ?;
|
|||||||
INSERT INTO sessions (id, user_id, expires_at)
|
INSERT INTO sessions (id, user_id, expires_at)
|
||||||
VALUES (?, ?, ?);
|
VALUES (?, ?, ?);
|
||||||
|
|
||||||
|
-- name: DeleteSession :exec
|
||||||
|
DELETE FROM sessions
|
||||||
|
WHERE id = ?;
|
||||||
|
|
||||||
-- name: RevokeClientApproval :exec
|
-- name: RevokeClientApproval :exec
|
||||||
DELETE FROM client_approvals
|
DELETE FROM client_approvals
|
||||||
WHERE user_id = ? AND client_id = ?;
|
WHERE user_id = ? AND client_id = ?;
|
||||||
|
|||||||
Reference in New Issue
Block a user