mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-05 22:20:01 +08:00
feat: support MetaMask provider (#2084)
* feat: add metamask provider * feat: add eth login * feat: check eth sign * feat: finish metamask signin/signup * feat: support MetaMask provider link/unlink * feat: update web/craco.config.js to handle polyfill * feat: gofumpt idp/metamask.go * feat: update MetaMask logo path * feat: support MetaMask avatar
This commit is contained in:
@ -36,6 +36,7 @@ import PopconfirmModal from "./common/modal/PopconfirmModal";
|
||||
import {DeleteMfa} from "./backend/MfaBackend";
|
||||
import {CheckCircleOutlined, HolderOutlined, UsergroupAddOutlined} from "@ant-design/icons";
|
||||
import * as MfaBackend from "./backend/MfaBackend";
|
||||
import AccountAvatar from "./account/AccountAvatar";
|
||||
|
||||
const {Option} = Select;
|
||||
|
||||
@ -791,10 +792,23 @@ class UserEditPage extends React.Component {
|
||||
{
|
||||
(this.state.application === null || this.state.user === null) ? null : (
|
||||
this.state.application?.providers.filter(providerItem => Setting.isProviderVisible(providerItem)).map((providerItem) =>
|
||||
(providerItem.provider.category === "OAuth") ? (
|
||||
<OAuthWidget key={providerItem.name} labelSpan={(Setting.isMobile()) ? 10 : 3} user={this.state.user} application={this.state.application} providerItem={providerItem} account={this.props.account} onUnlinked={() => {return this.unlinked();}} />
|
||||
(providerItem.provider.category === "OAuth" || providerItem.provider.category === "Web3") ? (
|
||||
<OAuthWidget
|
||||
key={providerItem.name}
|
||||
labelSpan={(Setting.isMobile()) ? 10 : 3}
|
||||
user={this.state.user}
|
||||
application={this.state.application}
|
||||
providerItem={providerItem}
|
||||
account={this.props.account}
|
||||
onUnlinked={() => {return this.unlinked();}} />
|
||||
) : (
|
||||
<SamlWidget key={providerItem.name} labelSpan={(Setting.isMobile()) ? 10 : 3} user={this.state.user} application={this.state.application} providerItem={providerItem} onUnlinked={() => {return this.unlinked();}} />
|
||||
<SamlWidget
|
||||
key={providerItem.name}
|
||||
labelSpan={(Setting.isMobile()) ? 10 : 3}
|
||||
user={this.state.user}
|
||||
application={this.state.application}
|
||||
providerItem={providerItem}
|
||||
onUnlinked={() => {return this.unlinked();}} />
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -971,7 +985,7 @@ class UserEditPage extends React.Component {
|
||||
{
|
||||
imgUrl ?
|
||||
<a target="_blank" rel="noreferrer" href={imgUrl} style={{marginBottom: "10px"}}>
|
||||
<img src={imgUrl} alt={imgUrl} height={90} style={{marginBottom: "20px"}} />
|
||||
<AccountAvatar src={imgUrl} alt={imgUrl} size={90} style={{marginBottom: "20px"}} />
|
||||
</a>
|
||||
:
|
||||
<Col style={{height: "78%", border: "1px dotted grey", borderRadius: 3, marginBottom: 5}}>
|
||||
|
Reference in New Issue
Block a user