fix: redirect users to /refresh on unauth and mod webview links

This commit is contained in:
Christel Westerberg
2024-05-16 16:57:22 +02:00
parent 777fd1e5b6
commit 9e4f41ee46
29 changed files with 358 additions and 105 deletions

View File

@@ -1,6 +1,7 @@
import JsonToHtml from "@/components/JsonToHtml"
import Overview from "@/components/MyPages/Blocks/Overview"
import Shortcuts from "@/components/MyPages/Blocks/Shortcuts"
import { modWebviewLink } from "@/utils/webviews"
import {
AccountPageContentProps,
@@ -31,7 +32,7 @@ export default function Content({ lang, content }: ContentProps) {
href:
item.dynamic_content.link.linkConnection.edges[0].node
.original_url ||
`/${lang}${item.dynamic_content.link.linkConnection.edges[0].node.url}`,
`/${lang}/webview${item.dynamic_content.link.linkConnection.edges[0].node.url}`,
text: item.dynamic_content.link.link_text,
}
: null
@@ -50,9 +51,15 @@ export default function Content({ lang, content }: ContentProps) {
/>
)
case ContentEntries.AccountPageContentShortcuts:
const shortcuts = item.shortcuts.shortcuts.map((shortcut) => {
return {
...shortcut,
url: modWebviewLink(shortcut.url, lang),
}
})
return (
<Shortcuts
shortcuts={item.shortcuts.shortcuts}
shortcuts={shortcuts}
subtitle={item.shortcuts.preamble}
title={item.shortcuts.title}
/>