mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Server: Fixed certain URLs
This commit is contained in:
parent
19b45de298
commit
282f782d50
@ -6,6 +6,7 @@ import { pathExists } from 'fs-extra';
|
|||||||
import * as fs from 'fs-extra';
|
import * as fs from 'fs-extra';
|
||||||
import { AppContext, RouteType } from '../utils/types';
|
import { AppContext, RouteType } from '../utils/types';
|
||||||
import { localFileFromUrl } from '../utils/joplinUtils';
|
import { localFileFromUrl } from '../utils/joplinUtils';
|
||||||
|
import { homeUrl, loginUrl } from '../utils/urlUtils';
|
||||||
const { mime } = require('@joplin/lib/mime-utils.js');
|
const { mime } = require('@joplin/lib/mime-utils.js');
|
||||||
|
|
||||||
const publicDir = `${dirname(dirname(__dirname))}/public`;
|
const publicDir = `${dirname(dirname(__dirname))}/public`;
|
||||||
@ -58,9 +59,9 @@ router.get('', async (path: SubPath, ctx: AppContext) => {
|
|||||||
// Redirect to either /login or /home when trying to access the root
|
// Redirect to either /login or /home when trying to access the root
|
||||||
if (!path.id && !path.link) {
|
if (!path.id && !path.link) {
|
||||||
if (ctx.joplin.owner) {
|
if (ctx.joplin.owner) {
|
||||||
return redirect(ctx, 'home');
|
return redirect(ctx, homeUrl());
|
||||||
} else {
|
} else {
|
||||||
return redirect(ctx, 'login');
|
return redirect(ctx, loginUrl());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,3 +34,11 @@ export function confirmUrl(userId: Uuid, validationToken: string): string {
|
|||||||
export function stripePortalUrl(): string {
|
export function stripePortalUrl(): string {
|
||||||
return `${config().baseUrl}/stripe/portal`;
|
return `${config().baseUrl}/stripe/portal`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function homeUrl(): string {
|
||||||
|
return `${config().baseUrl}/home`;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function loginUrl(): string {
|
||||||
|
return `${config().baseUrl}/login`;
|
||||||
|
}
|
||||||
|
@ -26,6 +26,6 @@
|
|||||||
|
|
||||||
{{#showUpgradeProButton}}
|
{{#showUpgradeProButton}}
|
||||||
<p class="block">
|
<p class="block">
|
||||||
<a href="{{baseUrl}}/upgrade" class="upgrade-button">Upgrade to a Pro account</a> to benefit from collaborate on notebooks, to increase the max note size, or the max total size.
|
<a href="{{{global.baseUrl}}}/upgrade" class="upgrade-button">Upgrade to a Pro account</a> to collaborate on notebooks with other people, to increase the max note size, or the max total size.
|
||||||
</p>
|
</p>
|
||||||
{{/showUpgradeProButton}}
|
{{/showUpgradeProButton}}
|
||||||
|
Loading…
Reference in New Issue
Block a user