Accidentally missed the API URIs

This commit is contained in:
Tracker-Friendly 2024-10-15 19:30:30 +01:00
parent bf842ab498
commit b3c82ecab6
1 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ func main() {
formData.Set("code_verifier", localStorage.Call("getItem", "OAUTH-verifier").String())
// Create the request
requestUri, err := url.JoinPath(js.Global().Get("window").Get("location").Get("origin").String(), "/api/oauth/token")
requestUri, err := url.JoinPath(js.Global().Get("window").Get("location").Get("origin").String(), js.Global().Get("document").Call("getElementById", "authorizationUri").Get("innerText").String()+"/token")
if err != nil {
statusBox.Set("innerText", "Error joining URL: "+err.Error())
tryAgain.Set("style", "")
@ -104,7 +104,7 @@ func main() {
if response.StatusCode == 200 {
// Fetch userinfo
requestUri, err := url.JoinPath(js.Global().Get("window").Get("location").Get("origin").String(), "/api/oauth/userinfo")
requestUri, err := url.JoinPath(js.Global().Get("window").Get("location").Get("origin").String(), js.Global().Get("document").Call("getElementById", "authorizationUri").Get("innerText").String()+"/userinfo")
if err != nil {
statusBox.Set("innerText", "Error joining URL: "+err.Error())
tryAgain.Set("style", "")