From c122e89fc154e4d1276af4987578d52bb779dfbd Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Mon, 14 Jun 2021 23:23:59 +0800 Subject: [PATCH] Improve jump links. --- web/src/Setting.js | 12 ++++++++++++ web/src/auth/Util.js | 16 ++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/web/src/Setting.js b/web/src/Setting.js index 9c2b7d32..f19066c4 100644 --- a/web/src/Setting.js +++ b/web/src/Setting.js @@ -262,6 +262,12 @@ export function goToLogin(ths, application) { return; } + if (!application.enablePassword && window.location.pathname.includes("/signup/oauth/authorize")) { + const link = window.location.href.replace("/signup/oauth/authorize", "/login/oauth/authorize"); + goToLink(link); + return; + } + if (authConfig.appName === application.name) { goToLinkSoft(ths, "/login"); } else { @@ -278,6 +284,12 @@ export function goToSignup(ths, application) { return; } + if (!application.enablePassword && window.location.pathname.includes("/login/oauth/authorize")) { + const link = window.location.href.replace("/login/oauth/authorize", "/signup/oauth/authorize"); + goToLink(link); + return; + } + if (authConfig.appName === application.name) { goToLinkSoft(ths, "/signup"); } else { diff --git a/web/src/auth/Util.js b/web/src/auth/Util.js index 00dce63d..204af1a6 100644 --- a/web/src/auth/Util.js +++ b/web/src/auth/Util.js @@ -14,7 +14,6 @@ import React from "react"; import {Alert, Button, message, Result} from "antd"; -import * as Setting from "../Setting"; export function showMessage(type, text) { if (type === "success") { @@ -55,12 +54,17 @@ export function renderMessageLarge(ths, msg) { title="There was a problem signing you in.." subTitle={msg} extra={[ - , - , + // , + // , ]} >