1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Server: Go back to home page when there is an error and user is logged in

This commit is contained in:
Laurent Cozic 2021-05-16 12:19:18 +02:00
parent 2655b6deee
commit a24b0091ad
2 changed files with 7 additions and 1 deletions

View File

@ -52,6 +52,7 @@ export default async function(ctx: AppContext) {
content: {
error,
stack: ctx.env === Env.Dev ? error.stack : '',
owner: ctx.owner,
},
};
ctx.response.body = await mustache().renderView(view);

View File

@ -6,6 +6,11 @@
<pre>{{.}}</pre>
{{/stack}}
</div>
<p><a href="{{{global.baseUrl}}}/login">Back to the login page</a></p>
{{#owner}}
<p><a href="{{{global.baseUrl}}}/home">Back to home page</a></p>
{{/owner}}
{{^owner}}
<p><a href="{{{global.baseUrl}}}/login">Back to login page</a></p>
{{/owner}}
</div>
</div>