fixed login bug
This commit is contained in:
@@ -237,7 +237,7 @@ async function login(username, password, captcha) {
|
||||
try {
|
||||
const info = JSON.parse(localStorage.getItem("instanceinfo"));
|
||||
const api = info.login + (info.login.startsWith("/") ? "/" : "");
|
||||
return await fetch(api + 'auth/login', options).then(response => response.json())
|
||||
return await fetch(api + '/auth/login', options).then(response => response.json())
|
||||
.then((response) => {
|
||||
console.log(response, response.message);
|
||||
if ("Invalid Form Body" === response.message) {
|
||||
@@ -282,6 +282,8 @@ async function login(username, password, captcha) {
|
||||
}
|
||||
else {
|
||||
console.warn(response);
|
||||
if (!response.token)
|
||||
return;
|
||||
adduser({ serverurls: JSON.parse(localStorage.getItem("instanceinfo")), email: username, token: response.token }).username = username;
|
||||
const redir = new URLSearchParams(window.location.search).get("goback");
|
||||
if (redir) {
|
||||
@@ -296,6 +298,8 @@ async function login(username, password, captcha) {
|
||||
}
|
||||
else {
|
||||
console.warn(response);
|
||||
if (!response.token)
|
||||
return;
|
||||
adduser({ serverurls: JSON.parse(localStorage.getItem("instanceinfo")), email: username, token: response.token }).username = username;
|
||||
const redir = new URLSearchParams(window.location.search).get("goback");
|
||||
if (redir) {
|
||||
|
Reference in New Issue
Block a user