Skip to content

Commit

Permalink
feat: new client-side hook to allow plugins to modify relogin url
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed Apr 2, 2024
1 parent 58c4654 commit c778f6e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion public/src/modules/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ async function call(options, callback) {
return result;
} catch (err) {
if (err.message === 'A valid login session was not found. Please log in and try again.') {
const { url } = await fireHook('filter:admin.reauth', { url: 'login' });
return confirm('[[error:api.reauth-required]]', (ok) => {
if (ok) {
ajaxify.go('login');
ajaxify.go(url);
}
});
}
Expand Down

0 comments on commit c778f6e

Please sign in to comment.