Change schema of url environment variables (#1237)

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2021-05-05 22:33:30 +02:00 committed by GitHub
parent 41e493c8bc
commit a48b4f60bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 33 additions and 33 deletions

View file

@ -11,7 +11,7 @@ export const BANNER_LOCAL_STORAGE_KEY = 'banner.lastModified'
export const fetchAndSetBanner = async (customizeAssetsUrl: string): Promise<void> => {
const cachedLastModified = window.localStorage.getItem(BANNER_LOCAL_STORAGE_KEY)
const bannerUrl = `${ customizeAssetsUrl }/banner.txt`
const bannerUrl = `${ customizeAssetsUrl }banner.txt`
if (cachedLastModified) {
const response = await fetch(bannerUrl, {

View file

@ -19,7 +19,7 @@ export const setUpI18n = async (frontendAssetsUrl: string): Promise<void> => {
fallbackLng: 'en',
debug: process.env.NODE_ENV !== 'production',
backend: {
loadPath: `${ frontendAssetsUrl }/locales/{{lng}}.json`
loadPath: `${ frontendAssetsUrl }locales/{{lng}}.json`
},
interpolation: {

View file

@ -26,7 +26,7 @@ export interface InitTask {
export const createSetUpTaskList = (frontendAssetsUrl: string, customizeAssetsUrl: string, backendBaseUrl: string): InitTask[] => {
setApiUrl({
apiUrl: `${ backendBaseUrl }/api/private`
apiUrl: `${ backendBaseUrl }api/private/`
})
return [{

View file

@ -7,7 +7,7 @@
import { defaultFetchConfig, expectResponseCode } from '../../api/utils'
export const fetchFrontPageContent = async (customizeAssetsUrl: string): Promise<string> => {
const response = await fetch(customizeAssetsUrl + '/intro.md', {
const response = await fetch(customizeAssetsUrl + 'intro.md', {
...defaultFetchConfig,
method: 'GET'
})

View file

@ -30,7 +30,7 @@ export const SignInButton: React.FC<SignInButtonProps> = ({ variant, ...props })
const activeOneClickProviders = activeProviders.filter(entry => !INTERACTIVE_LOGIN_METHODS.includes(entry))
if (activeProviders.length === 1 && activeOneClickProviders.length === 1) {
return `${ getApiUrl() }/auth/${ activeOneClickProviders[0] }`
return `${ getApiUrl() }auth/${ activeOneClickProviders[0] }`
}
return '/login'
}, [authProviders])

View file

@ -63,7 +63,7 @@ export const ProfileAccountManagement: React.FC = () => {
<Card className="bg-dark mb-4">
<Card.Body>
<Card.Title><Trans i18nKey="profile.accountManagement"/></Card.Title>
<Button variant="secondary" block href={ getApiUrl() + '/me/export' } className="mb-2">
<Button variant="secondary" block href={ getApiUrl() + 'me/export' } className="mb-2">
<ForkAwesomeIcon icon="cloud-download" fixedWidth={ true } className="mx-2"/>
<Trans i18nKey="profile.exportUserData"/>
</Button>