mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 05:10:19 +08:00
Check user under org.
This commit is contained in:
@ -273,7 +273,7 @@ class App extends Component {
|
||||
</Header>
|
||||
<Switch>
|
||||
<Route exact path="/login" render={(props) => this.renderHomeIfLoggedIn(<LoginPage onLoggedIn={this.onLoggedIn.bind(this)} {...props} />)}/>
|
||||
<Route exact path="/callback/:providerType/:providerName/:method" component={AuthCallback}/>
|
||||
<Route exact path="/callback/:applicationName/:providerName/:method" component={AuthCallback}/>
|
||||
<Route exact path="/" render={(props) => this.renderLoginIfNotLoggedIn(<HomePage account={this.state.account} onLoggedIn={this.onLoggedIn.bind(this)} {...props} />)}/>
|
||||
<Route exact path="/account" render={(props) => this.renderLoginIfNotLoggedIn(<AccountPage account={this.state.account} {...props} />)}/>
|
||||
<Route exact path="/organizations" render={(props) => this.renderLoginIfNotLoggedIn(<OrganizationListPage account={this.state.account} {...props} />)}/>
|
||||
|
@ -198,6 +198,24 @@ class UserEditPage extends React.Component {
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: '20px'}} >
|
||||
<Col style={{marginTop: '5px'}} span={2}>
|
||||
Tag:
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Input value={this.state.user.tag} onChange={e => {
|
||||
this.updateUserField('tag', e.target.value);
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: '20px'}} >
|
||||
<Col style={{marginTop: '5px'}} span={2}>
|
||||
GitHub:
|
||||
</Col>
|
||||
<Col span={22} >
|
||||
<Input value={this.state.user.github} disabled={true} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: '20px'}} >
|
||||
<Col style={{marginTop: '5px'}} span={2}>
|
||||
Is Admin:
|
||||
|
@ -104,7 +104,7 @@ class UserListPage extends React.Component {
|
||||
title: 'Name',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
width: '120px',
|
||||
width: '100px',
|
||||
sorter: (a, b) => a.name.localeCompare(b.name),
|
||||
render: (text, record, index) => {
|
||||
return (
|
||||
@ -124,13 +124,13 @@ class UserListPage extends React.Component {
|
||||
return Setting.getFormattedDate(text);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Password Type',
|
||||
dataIndex: 'passwordType',
|
||||
key: 'passwordType',
|
||||
width: '150px',
|
||||
sorter: (a, b) => a.passwordType.localeCompare(b.passwordType),
|
||||
},
|
||||
// {
|
||||
// title: 'Password Type',
|
||||
// dataIndex: 'passwordType',
|
||||
// key: 'passwordType',
|
||||
// width: '150px',
|
||||
// sorter: (a, b) => a.passwordType.localeCompare(b.passwordType),
|
||||
// },
|
||||
// {
|
||||
// title: 'Password',
|
||||
// dataIndex: 'password',
|
||||
@ -162,7 +162,7 @@ class UserListPage extends React.Component {
|
||||
title: 'Email',
|
||||
dataIndex: 'email',
|
||||
key: 'email',
|
||||
width: '180px',
|
||||
width: '160px',
|
||||
sorter: (a, b) => a.email.localeCompare(b.email),
|
||||
render: (text, record, index) => {
|
||||
return (
|
||||
@ -172,13 +172,13 @@ class UserListPage extends React.Component {
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Phone',
|
||||
dataIndex: 'phone',
|
||||
key: 'phone',
|
||||
width: '120px',
|
||||
sorter: (a, b) => a.phone.localeCompare(b.phone),
|
||||
},
|
||||
// {
|
||||
// title: 'Phone',
|
||||
// dataIndex: 'phone',
|
||||
// key: 'phone',
|
||||
// width: '120px',
|
||||
// sorter: (a, b) => a.phone.localeCompare(b.phone),
|
||||
// },
|
||||
{
|
||||
title: 'Affiliation',
|
||||
dataIndex: 'affiliation',
|
||||
@ -186,6 +186,13 @@ class UserListPage extends React.Component {
|
||||
width: '120px',
|
||||
sorter: (a, b) => a.affiliation.localeCompare(b.affiliation),
|
||||
},
|
||||
{
|
||||
title: 'Tag',
|
||||
dataIndex: 'tag',
|
||||
key: 'tag',
|
||||
width: '100px',
|
||||
sorter: (a, b) => a.tag.localeCompare(b.tag),
|
||||
},
|
||||
{
|
||||
title: 'Is Admin',
|
||||
dataIndex: 'isAdmin',
|
||||
|
@ -44,8 +44,8 @@ export function logout() {
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function authLogin(providerName, code, state, redirectUrl, method) {
|
||||
return fetch(`${authConfig.serverUrl}/api/auth/login?provider=${providerName}&code=${code}&state=${state}&redirect_url=${redirectUrl}&method=${method}`, {
|
||||
export function authLogin(applicationName, providerName, code, state, redirectUrl, method) {
|
||||
return fetch(`${authConfig.serverUrl}/api/auth/login?application=${applicationName}&provider=${providerName}&code=${code}&state=${state}&redirect_url=${redirectUrl}&method=${method}`, {
|
||||
method: 'GET',
|
||||
credentials: 'include',
|
||||
}).then(res => res.json());
|
||||
|
@ -23,7 +23,7 @@ class AuthCallback extends React.Component {
|
||||
const params = new URLSearchParams(this.props.location.search);
|
||||
this.state = {
|
||||
classes: props,
|
||||
providerType: props.match.params.providerType,
|
||||
applicationName: props.match.params.applicationName,
|
||||
providerName: props.match.params.providerName,
|
||||
method: props.match.params.method,
|
||||
state: params.get("state"),
|
||||
@ -48,8 +48,8 @@ class AuthCallback extends React.Component {
|
||||
|
||||
authLogin() {
|
||||
let redirectUrl;
|
||||
redirectUrl = `${window.location.origin}/callback/${this.state.providerType}/${this.state.providerName}/${this.state.method}`;
|
||||
AuthBackend.authLogin(this.state.providerName, this.state.code, this.state.state, redirectUrl, this.state.method)
|
||||
redirectUrl = `${window.location.origin}/callback/${this.state.applicationName}/${this.state.providerName}/${this.state.method}`;
|
||||
AuthBackend.authLogin(this.state.applicationName, this.state.providerName, this.state.code, this.state.state, redirectUrl, this.state.method)
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
window.location.href = '/';
|
||||
|
@ -128,7 +128,7 @@ class Face extends React.Component {
|
||||
{
|
||||
this.getApplicationObj().providerObjs.map(provider => {
|
||||
return (
|
||||
<a href={Provider.getAuthUrl(provider, "signup")}>
|
||||
<a href={Provider.getAuthUrl(this.getApplicationObj(), provider, "signup")}>
|
||||
<img width={30} height={30} src={Provider.getAuthLogo(provider)} alt={provider.displayName} style={{margin: "3px"}} />
|
||||
</a>
|
||||
);
|
||||
|
@ -42,8 +42,8 @@ export function getAuthLogo(provider) {
|
||||
}
|
||||
}
|
||||
|
||||
export function getAuthUrl(provider, method) {
|
||||
const redirectUri = `${window.location.origin}/callback/${provider.type}/${provider.name}/${method}`;
|
||||
export function getAuthUrl(application, provider, method) {
|
||||
const redirectUri = `${window.location.origin}/callback/${application.name}/${provider.name}/${method}`;
|
||||
if (provider.type === "google") {
|
||||
return `${GoogleAuthUri}?client_id=${provider.clientId}&redirect_uri=${redirectUri}&scope=${GoogleAuthScope}&response_type=code&state=${AuthState}`;
|
||||
} else if (provider.type === "github") {
|
||||
|
Reference in New Issue
Block a user