fix: linter error

pull/4654/head
johnnyjoy 6 months ago
parent eb33a604b2
commit 411a91122b

@ -23,11 +23,11 @@ const templateList: IdentityProvider[] = [
tokenUrl: "https://github.com/login/oauth/access_token", tokenUrl: "https://github.com/login/oauth/access_token",
userInfoUrl: "https://api.github.com/user", userInfoUrl: "https://api.github.com/user",
scopes: ["read:user"], scopes: ["read:user"],
fieldMapping: { fieldMapping: FieldMapping.fromPartial({
identifier: "login", identifier: "login",
displayName: "name", displayName: "name",
email: "email", email: "email",
}, }),
}, },
}, },
}, },
@ -44,11 +44,11 @@ const templateList: IdentityProvider[] = [
tokenUrl: "https://gitlab.com/oauth/token", tokenUrl: "https://gitlab.com/oauth/token",
userInfoUrl: "https://gitlab.com/oauth/userinfo", userInfoUrl: "https://gitlab.com/oauth/userinfo",
scopes: ["openid"], scopes: ["openid"],
fieldMapping: { fieldMapping: FieldMapping.fromPartial({
identifier: "name", identifier: "name",
displayName: "name", displayName: "name",
email: "email", email: "email",
}, }),
}, },
}, },
}, },
@ -65,11 +65,11 @@ const templateList: IdentityProvider[] = [
tokenUrl: "https://oauth2.googleapis.com/token", tokenUrl: "https://oauth2.googleapis.com/token",
userInfoUrl: "https://www.googleapis.com/oauth2/v2/userinfo", userInfoUrl: "https://www.googleapis.com/oauth2/v2/userinfo",
scopes: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile"], scopes: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile"],
fieldMapping: { fieldMapping: FieldMapping.fromPartial({
identifier: "email", identifier: "email",
displayName: "name", displayName: "name",
email: "email", email: "email",
}, }),
}, },
}, },
}, },
@ -86,11 +86,11 @@ const templateList: IdentityProvider[] = [
tokenUrl: "", tokenUrl: "",
userInfoUrl: "", userInfoUrl: "",
scopes: [], scopes: [],
fieldMapping: { fieldMapping: FieldMapping.fromPartial({
identifier: "", identifier: "",
displayName: "", displayName: "",
email: "", email: "",
}, }),
}, },
}, },
}, },
@ -117,11 +117,11 @@ const CreateIdentityProviderDialog: React.FC<Props> = (props: Props) => {
tokenUrl: "", tokenUrl: "",
userInfoUrl: "", userInfoUrl: "",
scopes: [], scopes: [],
fieldMapping: { fieldMapping: FieldMapping.fromPartial({
identifier: "", identifier: "",
displayName: "", displayName: "",
email: "", email: "",
}, }),
}); });
const [oauth2Scopes, setOAuth2Scopes] = useState<string>(""); const [oauth2Scopes, setOAuth2Scopes] = useState<string>("");
const [selectedTemplate, setSelectedTemplate] = useState<string>("GitHub"); const [selectedTemplate, setSelectedTemplate] = useState<string>("GitHub");
@ -418,6 +418,18 @@ const CreateIdentityProviderDialog: React.FC<Props> = (props: Props) => {
} }
fullWidth 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"> <div className="mt-2 w-full flex flex-row justify-end items-center space-x-1">

Loading…
Cancel
Save