fix: use current window url instead of app url in frontend

This commit is contained in:
Elias Schneider
2024-11-14 19:10:11 +01:00
parent ff2dd81055
commit 6f45c3b1fb
12 changed files with 24 additions and 56 deletions

View File

@@ -279,10 +279,7 @@ const Account = () => {
) : (
<Button
component="a"
href={getOAuthUrl(
config.get("general.appUrl"),
provider,
)}
href={getOAuthUrl(window.location.origin, provider)}
>
{t("account.card.oauth.link")}
</Button>

View File

@@ -37,8 +37,6 @@ const MyShares = () => {
const config = useConfig();
const appUrl = config.get("general.appUrl");
const [reverseShares, setReverseShares] = useState<MyReverseShare[]>();
const getReverseShares = () => {
@@ -146,7 +144,7 @@ const MyShares = () => {
{reverseShare.shares.map((share) => (
<Group key={share.id} mb={4}>
<Anchor
href={`${appUrl}/share/${share.id}`}
href={`${window.location.origin}/share/${share.id}`}
target="_blank"
>
<Text maw={120} truncate>
@@ -159,14 +157,12 @@ const MyShares = () => {
size={25}
onClick={() => {
if (window.isSecureContext) {
clipboard.copy(`${appUrl}/s/${share.id}`);
clipboard.copy(
`${window.location.origin}/s/${share.id}`,
);
toast.success(t("common.notify.copied"));
} else {
showShareLinkModal(
modals,
share.id,
config.get("general.appUrl"),
);
showShareLinkModal(modals, share.id);
}
}}
>
@@ -197,7 +193,7 @@ const MyShares = () => {
onClick={() => {
if (window.isSecureContext) {
clipboard.copy(
`${config.get("general.appUrl")}/upload/${
`${window.location.origin}/upload/${
reverseShare.token
}`,
);
@@ -206,7 +202,6 @@ const MyShares = () => {
showReverseShareLinkModal(
modals,
reverseShare.token,
config.get("general.appUrl"),
);
}
}}

View File

@@ -4,7 +4,6 @@ import {
Button,
Center,
Group,
MediaQuery,
Space,
Stack,
Table,
@@ -109,7 +108,6 @@ const MyShares = () => {
showShareInformationsModal(
modals,
share,
config.get("general.appUrl"),
parseInt(config.get("share.maxSize")),
);
}}
@@ -123,15 +121,11 @@ const MyShares = () => {
onClick={() => {
if (window.isSecureContext) {
clipboard.copy(
`${config.get("general.appUrl")}/s/${share.id}`,
`${window.location.origin}/s/${share.id}`,
);
toast.success(t("common.notify.copied"));
} else {
showShareLinkModal(
modals,
share.id,
config.get("general.appUrl"),
);
showShareLinkModal(modals, share.id);
}
}}
>

View File

@@ -135,7 +135,6 @@ const Upload = ({
{
isUserSignedIn: user ? true : false,
isReverseShare,
appUrl: config.get("general.appUrl"),
allowUnauthenticatedShares: config.get(
"share.allowUnauthenticatedShares",
),
@@ -189,7 +188,7 @@ const Upload = ({
.completeShare(createdShare.id)
.then((share) => {
setisUploading(false);
showCompletedUploadModal(modals, share, config.get("general.appUrl"));
showCompletedUploadModal(modals, share);
setFiles([]);
})
.catch(() => toast.error(t("upload.notify.generic-error")));