mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 13:20:19 +08:00
Directly login with the only OAuth provider.
This commit is contained in:
@ -19,6 +19,7 @@ import * as AuthBackend from "./AuthBackend";
|
|||||||
import * as Util from "./Util";
|
import * as Util from "./Util";
|
||||||
import {authConfig} from "./Auth";
|
import {authConfig} from "./Auth";
|
||||||
import * as Setting from "../Setting";
|
import * as Setting from "../Setting";
|
||||||
|
import i18next from "i18next";
|
||||||
|
|
||||||
class AuthCallback extends React.Component {
|
class AuthCallback extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@ -121,7 +122,7 @@ class AuthCallback extends React.Component {
|
|||||||
<div style={{textAlign: "center"}}>
|
<div style={{textAlign: "center"}}>
|
||||||
{
|
{
|
||||||
(this.state.msg === null) ? (
|
(this.state.msg === null) ? (
|
||||||
<Spin size="large" tip="Signing in..." style={{paddingTop: "10%"}} />
|
<Spin size="large" tip={i18next.t("login:Signing in...")} style={{paddingTop: "10%"}} />
|
||||||
) : (
|
) : (
|
||||||
Util.renderMessageLarge(this, this.state.msg)
|
Util.renderMessageLarge(this, this.state.msg)
|
||||||
)
|
)
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import {Link} from "react-router-dom";
|
import {Link} from "react-router-dom";
|
||||||
import {Button, Checkbox, Col, Form, Input, Result, Row} from "antd";
|
import {Button, Checkbox, Col, Form, Input, Result, Row, Spin} from "antd";
|
||||||
import {LockOutlined, UserOutlined} from "@ant-design/icons";
|
import {LockOutlined, UserOutlined} from "@ant-design/icons";
|
||||||
import * as AuthBackend from "./AuthBackend";
|
import * as AuthBackend from "./AuthBackend";
|
||||||
import * as ApplicationBackend from "../backend/ApplicationBackend";
|
import * as ApplicationBackend from "../backend/ApplicationBackend";
|
||||||
@ -232,7 +232,6 @@ class LoginPage extends React.Component {
|
|||||||
initialValues={{
|
initialValues={{
|
||||||
organization: application.organization,
|
organization: application.organization,
|
||||||
application: application.name,
|
application: application.name,
|
||||||
remember: true,
|
|
||||||
autoSignin: true,
|
autoSignin: true,
|
||||||
}}
|
}}
|
||||||
onFinish={(values) => {this.onFinish(values)}}
|
onFinish={(values) => {this.onFinish(values)}}
|
||||||
@ -381,6 +380,16 @@ class LoginPage extends React.Component {
|
|||||||
return Util.renderMessageLarge(this, this.state.msg);
|
return Util.renderMessageLarge(this, this.state.msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const visibleOAuthProviderItems = application.providers.filter(providerItem => this.isProviderVisible(providerItem));
|
||||||
|
if (this.props.application === undefined && visibleOAuthProviderItems.length === 1) {
|
||||||
|
Setting.goToLink(Provider.getAuthUrl(application, visibleOAuthProviderItems[0].provider, "signup"));
|
||||||
|
return (
|
||||||
|
<div style={{textAlign: "center"}}>
|
||||||
|
<Spin size="large" tip={i18next.t("login:Signing in...")} style={{paddingTop: "10%"}} />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row>
|
<Row>
|
||||||
<Col span={24} style={{display: "flex", justifyContent: "center"}}>
|
<Col span={24} style={{display: "flex", justifyContent: "center"}}>
|
||||||
|
Reference in New Issue
Block a user