Skip to content

Commit

Permalink
update: logout on a successful restore.
Browse files Browse the repository at this point in the history
  • Loading branch information
ItzNotABug committed Sep 15, 2024
1 parent 99b5cc1 commit 11251c6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions routes/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ router.post('/configs', async (req, res) => {
res.render('dashboard/import-export', {
level,
message,
invalidate_session: level === 'success',
});
});

Expand Down
4 changes: 2 additions & 2 deletions utils/data/transfers.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default class Transfers {

return {
level: 'success',
message: 'Import successful!',
message: 'Import successful! You will now be logged out.',
};
} catch (error) {
logError(logTags.Configs, error);
Expand Down Expand Up @@ -176,8 +176,8 @@ export default class Transfers {
'newsletter.show_subscription',
'newsletter.show_featured_image',
'newsletter.show_powered_by_ghost',
'newsletter.custom_subject_pattern',
'newsletter.show_powered_by_ghosler',
// 'newsletter.custom_subject_pattern',

'custom_template',
'custom_template.enabled',
Expand Down
4 changes: 4 additions & 0 deletions views/partials/common/message.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
alertMessage.style.margin = '0';
alertMessage.style.padding = '0';
}, 500);
<% if ((typeof invalidate_session !== 'undefined' && invalidate_session === true)) { %>
window.location.href = '/logout';
<% } %>
}, 3000);
</script>
<% } %>

0 comments on commit 11251c6

Please sign in to comment.