Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix: linter error

johnnyjoy411a91122bce
diff --git a/web/src/components/CreateIdentityProviderDialog.tsx b/web/src/components/CreateIdentityProviderDialog.tsx
index 025ecefb8..d24164735 100644
--- a/web/src/components/CreateIdentityProviderDialog.tsx
+++ b/web/src/components/CreateIdentityProviderDialog.tsx
@@ -23,11 +23,11 @@ const templateList: IdentityProvider[] = [
tokenUrl: "https://github.com/login/oauth/access_token",
userInfoUrl: "https://api.github.com/user",
scopes: ["read:user"],
- fieldMapping: {
+ fieldMapping: FieldMapping.fromPartial({
identifier: "login",
displayName: "name",
email: "email",
- },
+ }),
},
},
},
@@ -44,11 +44,11 @@ const templateList: IdentityProvider[] = [
tokenUrl: "https://gitlab.com/oauth/token",
userInfoUrl: "https://gitlab.com/oauth/userinfo",
scopes: ["openid"],
- fieldMapping: {
+ fieldMapping: FieldMapping.fromPartial({
identifier: "name",
displayName: "name",
email: "email",
- },
+ }),
},
},
},
@@ -65,11 +65,11 @@ const templateList: IdentityProvider[] = [
tokenUrl: "https://oauth2.googleapis.com/token",
userInfoUrl: "https://www.googleapis.com/oauth2/v2/userinfo",
scopes: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile"],
- fieldMapping: {
+ fieldMapping: FieldMapping.fromPartial({
identifier: "email",
displayName: "name",
email: "email",
- },
+ }),
},
},
},
@@ -86,11 +86,11 @@ const templateList: IdentityProvider[] = [
tokenUrl: "",
userInfoUrl: "",
scopes: [],
- fieldMapping: {
+ fieldMapping: FieldMapping.fromPartial({
identifier: "",
displayName: "",
email: "",
- },
+ }),
},
},
},
@@ -117,11 +117,11 @@ const CreateIdentityProviderDialog: React.FC<Props> = (props: Props) => {
tokenUrl: "",
userInfoUrl: "",
scopes: [],
- fieldMapping: {
+ fieldMapping: FieldMapping.fromPartial({
identifier: "",
displayName: "",
email: "",
- },
+ }),
});
const [oauth2Scopes, setOAuth2Scopes] = useState<string>("");
const [selectedTemplate, setSelectedTemplate] = useState<string>("GitHub");
@@ -418,6 +418,18 @@ const CreateIdentityProviderDialog: React.FC<Props> = (props: Props) => {
}
fullWidth
/>
+ <Typography className="!mb-1" level="body-md">
+ Avatar URL
+ </Typography>
+ <Input
+ className="mb-2"
+ placeholder={"Avatar URL"}
+ value={oauth2Config.fieldMapping!.avatarUrl}
+ onChange={(e) =>
+ setPartialOAuth2Config({ fieldMapping: { ...oauth2Config.fieldMapping, avatarUrl: e.target.value } as FieldMapping })
+ }
+ fullWidth
+ />
</>
)}
<div className="mt-2 w-full flex flex-row justify-end items-center space-x-1">