Updating JWT to use certificates

This commit is contained in:
2026-04-02 17:04:13 -04:00
parent 571aab64bb
commit 22a23c0062
6 changed files with 20 additions and 67 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"io"
"libshared"
"log"
"net/http"
"strings"
@@ -126,7 +127,7 @@ func createRole(w http.ResponseWriter, r *http.Request) {
log.Println("Description:", role.Description)
// Prevent duplication of roles with the same name for the same account
checkExisting := pool.QueryRow(context.Background(),
checkExisting := libshared.Pool.QueryRow(context.Background(),
"SELECT FROM roles WHERE accountid = $1 AND rolename = $2",
claims.Account, role.Rolename)
err = checkExisting.Scan()
@@ -136,7 +137,7 @@ func createRole(w http.ResponseWriter, r *http.Request) {
return
}
_, err = pool.Exec(
_, err = libshared.Pool.Exec(
context.Background(),
"INSERT INTO roles (accountid, rolename, description) VALUES ($1, $2, $3)",
claims.Account, role.Rolename, role.Description)