mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 05:10:19 +08:00
Use helmet on login, signup pages.
This commit is contained in:
@ -19,6 +19,7 @@ import "./i18n";
|
||||
import i18next from "i18next";
|
||||
import copy from "copy-to-clipboard";
|
||||
import {authConfig} from "./auth/Auth";
|
||||
import {Helmet} from "react-helmet";
|
||||
|
||||
export let ServerUrl = "";
|
||||
|
||||
@ -210,3 +211,16 @@ export function goToLogin(ths, application) {
|
||||
goToLink(`${application.homepageUrl}/login`);
|
||||
}
|
||||
}
|
||||
|
||||
export function renderHelmet(application) {
|
||||
if (application === undefined || application === null || application.organizationObj === undefined || application.organizationObj === null ||application.organizationObj === "") {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Helmet>
|
||||
<title>{application.organizationObj.displayName}</title>
|
||||
<link rel="icon" href={application.organizationObj.favicon} />
|
||||
</Helmet>
|
||||
)
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ import {GithubLoginButton, GoogleLoginButton} from "react-social-login-buttons";
|
||||
import QqLoginButton from "./QqLoginButton";
|
||||
import i18next from "i18next";
|
||||
import {authConfig} from "./Auth";
|
||||
import {Helmet} from "react-helmet";
|
||||
|
||||
class LoginPage extends React.Component {
|
||||
constructor(props) {
|
||||
@ -282,6 +283,9 @@ class LoginPage extends React.Component {
|
||||
<Row>
|
||||
<Col span={24} style={{display: "flex", justifyContent: "center"}}>
|
||||
<div style={{marginTop: "80px", textAlign: "center"}}>
|
||||
{
|
||||
Setting.renderHelmet(application)
|
||||
}
|
||||
{
|
||||
Setting.renderLogo(application)
|
||||
}
|
||||
|
@ -56,6 +56,9 @@ class ResultPage extends React.Component {
|
||||
|
||||
return (
|
||||
<div>
|
||||
{
|
||||
Setting.renderHelmet(application)
|
||||
}
|
||||
<Result
|
||||
status="success"
|
||||
title={i18next.t("signup:Your account has been created!")}
|
||||
|
@ -294,6 +294,9 @@ class SignupPage extends React.Component {
|
||||
<Row>
|
||||
<Col span={24} style={{display: "flex", justifyContent: "center"}} >
|
||||
<div style={{marginTop: "10px", textAlign: "center"}}>
|
||||
{
|
||||
Setting.renderHelmet(application)
|
||||
}
|
||||
{
|
||||
Setting.renderLogo(application)
|
||||
}
|
||||
|
Reference in New Issue
Block a user