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:
haiwu
2023-07-20 17:51:36 +08:00
committed by GitHub
parent f923a8f0d7
commit d7110ff8bf
32 changed files with 548 additions and 38 deletions

View File

@ -216,6 +216,12 @@ export const OtherProviderInfo = {
url: "https://platform.openai.com",
},
},
Web3: {
"MetaMask": {
logo: `${StaticBaseUrl}/img/social_metamask.svg`,
url: "https://metamask.io/",
},
},
};
export function initCountries() {
@ -288,7 +294,7 @@ export function isProviderVisible(providerItem) {
return false;
}
if (providerItem.provider.category !== "OAuth" && providerItem.provider.category !== "SAML") {
if (!["OAuth", "SAML", "Web3"].includes(providerItem.provider.category)) {
return false;
}
@ -891,6 +897,10 @@ export function getProviderTypeOptions(category) {
return ([
{id: "OpenAI API - GPT", name: "OpenAI API - GPT"},
]);
} else if (category === "Web3") {
return ([
{id: "MetaMask", name: "MetaMask"},
]);
} else {
return [];
}