Fixed names
This commit is contained in:
parent
66cd1defd8
commit
a904885023
2
main.go
2
main.go
|
@ -772,6 +772,7 @@ func main() {
|
||||||
err := conn.QueryRow("SELECT appId, rdiruri FROM oauth WHERE appId = ? LIMIT 1", appId).Scan(&appidcheck, &rdiruricheck)
|
err := conn.QueryRow("SELECT appId, rdiruri FROM oauth WHERE appId = ? LIMIT 1", appId).Scan(&appidcheck, &rdiruricheck)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, sql.ErrNoRows) {
|
if errors.Is(err, sql.ErrNoRows) {
|
||||||
|
fmt.Println(appId)
|
||||||
c.String(401, "OAuth screening failed")
|
c.String(401, "OAuth screening failed")
|
||||||
} else {
|
} else {
|
||||||
log.Println("[ERROR] Unknown in /api/auth at", strconv.FormatInt(time.Now().Unix(), 10)+":", err)
|
log.Println("[ERROR] Unknown in /api/auth at", strconv.FormatInt(time.Now().Unix(), 10)+":", err)
|
||||||
|
@ -785,6 +786,7 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if !(appidcheck == appId) {
|
if !(appidcheck == appId) {
|
||||||
|
fmt.Println(appidcheck, appId)
|
||||||
c.String(401, "OAuth screening failed")
|
c.String(401, "OAuth screening failed")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ if (remote == null) {
|
||||||
|
|
||||||
|
|
||||||
function attempt() {
|
function attempt() {
|
||||||
if (document.getElementById("appidbox").value.match(/^[A-Za-z]+$/)) {
|
if (document.getElementById("appidbox").value != "") {
|
||||||
fetch(origin + "/api/newauth", {
|
fetch(origin + "/api/newauth", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -83,6 +83,8 @@ function getauths() {
|
||||||
});
|
});
|
||||||
|
|
||||||
oauthElement.append(oauthText)
|
oauthElement.append(oauthText)
|
||||||
|
oauthElement.append(oauthName)
|
||||||
|
oauthElement.append(oauthUrl)
|
||||||
oauthElement.append(oauthRemoveButton)
|
oauthElement.append(oauthRemoveButton)
|
||||||
oauthElement.classList.add("oauthentry")
|
oauthElement.classList.add("oauthentry")
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<div class="newoauth">
|
<div class="newoauth">
|
||||||
<h2>Submit a new OAuth2 App</h2>
|
<h2>Submit a new OAuth2 App</h2>
|
||||||
<p id="status"></p>
|
<p id="status"></p>
|
||||||
<p>AppID:</p>
|
<p>App Name:</p>
|
||||||
<input id="appidbox">
|
<input id="appidbox">
|
||||||
<p>Redirect URI:</p>
|
<p>Redirect URI:</p>
|
||||||
<input id="rdiruribox">
|
<input id="rdiruribox">
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
// Get URL parameters
|
// Get URL parameters
|
||||||
if (urlParams.has('client_id')) {
|
if (urlParams.has('client_id')) {
|
||||||
|
client_id = urlParams.get('client_id')
|
||||||
let name = document.getElementById("passthrough").innerText;
|
let name = document.getElementById("passthrough").innerText;
|
||||||
statusBox.textContent = "Would you like to allow " + name + " to access your user information?";
|
statusBox.textContent = "Would you like to allow " + name + " to access your user information?";
|
||||||
redirect_uri = urlParams.get('redirect_uri');
|
redirect_uri = urlParams.get('redirect_uri');
|
||||||
|
|
Reference in New Issue