Updating JWT to use certificates
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user