mirror of
https://github.com/AnimeThemes/animethemes-web.git
synced 2026-07-11 01:24:31 +02:00
fix: Fixed site query parameter not getting appended to external profile auth URL
This commit is contained in:
@@ -55,8 +55,11 @@ interface ExternalProfileAddFormProps {
|
||||
function ExternalProfileAddForm({ preselectedSite, onCancel }: ExternalProfileAddFormProps) {
|
||||
const [site, setSite] = useState<ExternalProfileSite | "">(preselectedSite ?? "");
|
||||
|
||||
const authUrl = `${CLIENT_API_URL}/externaltoken/auth`;
|
||||
|
||||
return (
|
||||
<StyledForm action={site ? getAuthUrl(site) : undefined}>
|
||||
<StyledForm action={authUrl}>
|
||||
<input type="hidden" name="site" value={site} />
|
||||
<SearchFilterGroup>
|
||||
<SearchFilter>
|
||||
<Text variant="h2">External Site</Text>
|
||||
@@ -94,12 +97,3 @@ function ExternalProfileAddForm({ preselectedSite, onCancel }: ExternalProfileAd
|
||||
</StyledForm>
|
||||
);
|
||||
}
|
||||
|
||||
function getAuthUrl(site: ExternalProfileSite): string {
|
||||
switch (site) {
|
||||
case "AniList":
|
||||
return `${CLIENT_API_URL}/externaltoken/auth?site=AniList`;
|
||||
case "MyAnimeList":
|
||||
return `${CLIENT_API_URL}/externaltoken/auth?site=MyAnimeList`;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user