diff --git a/controllers/auth.go b/controllers/auth.go
index 20b6bcee..2f891764 100644
--- a/controllers/auth.go
+++ b/controllers/auth.go
@@ -164,7 +164,7 @@ func (c *ApiController) Login() {
c.ServeJSON()
return
} else {
- resp = &Response{Status: "error", Msg: "need sign up"}
+ resp = &Response{Status: "error", Msg: fmt.Sprintf("the account for provider: %s and username: %s does not exist, please register an account first", provider.Type, userInfo.Username)}
c.Data["json"] = resp
c.ServeJSON()
return
diff --git a/web/src/App.js b/web/src/App.js
index 86fbc233..7911866f 100644
--- a/web/src/App.js
+++ b/web/src/App.js
@@ -134,7 +134,7 @@ class App extends Component {
Setting.showMessage("success", `Successfully logged out, redirected to homepage`);
- Setting.goToLink("/");
+ Setting.goToLinkSoft(this, "/");
} else {
Setting.showMessage("error", `Failed to log out: ${res.msg}`);
}
@@ -292,7 +292,11 @@ class App extends Component {
{
- Setting.isMobile() ? null :
+ Setting.isMobile() ? null : (
+
+
+
+ )
}
diff --git a/web/src/auth/LoginPage.js b/web/src/auth/LoginPage.js
index 50b2fd54..fefa8dab 100644
--- a/web/src/auth/LoginPage.js
+++ b/web/src/auth/LoginPage.js
@@ -19,6 +19,7 @@ import {LockOutlined, UserOutlined} from "@ant-design/icons";
import * as AuthBackend from "./AuthBackend";
import * as Provider from "./Provider";
import * as Util from "./Util";
+import * as Setting from "../Setting";
class LoginPage extends React.Component {
constructor(props) {
@@ -90,10 +91,10 @@ class LoginPage extends React.Component {
const responseType = this.state.type;
if (responseType === "login") {
Util.showMessage("success", `Logged in successfully`);
- Util.goToLink("/");
+ Setting.goToLink("/");
} else if (responseType === "code") {
const code = res.data;
- Util.goToLink(`${oAuthParams.redirectUri}?code=${code}&state=${oAuthParams.state}`);
+ Setting.goToLink(`${oAuthParams.redirectUri}?code=${code}&state=${oAuthParams.state}`);
// Util.showMessage("success", `Authorization code: ${res.data}`);
}
} else {
@@ -208,7 +209,7 @@ class LoginPage extends React.Component {
render() {
const application = this.getApplicationObj();
if (application === null) {
- return Util.renderMessageLarge(this.state.msg);
+ return Util.renderMessageLarge(this, this.state.msg);
}
return (
diff --git a/web/src/auth/Util.js b/web/src/auth/Util.js
index d0a827f8..ab1dbf34 100644
--- a/web/src/auth/Util.js
+++ b/web/src/auth/Util.js
@@ -16,10 +16,6 @@ import React from "react";
import {Alert, Button, message, Result} from "antd";
import * as Setting from "../Setting";
-export function goToLink(link) {
- window.location.href = link;
-}
-
export function showMessage(type, text) {
if (type === "success") {
message.success(text);
@@ -50,7 +46,7 @@ export function renderMessage(msg) {
}
}
-export function renderMessageLarge(msg) {
+export function renderMessageLarge(ths, msg) {
if (msg !== null) {
return (
@@ -59,11 +55,11 @@ export function renderMessageLarge(msg) {
title="Login Error"
subTitle={msg}
extra={[
-