I have a few admin only routes in the plugin that I am developing.
The following are the middleware I have used.
const adminMiddlewares = [
However, the problem that I am running into the following problem.
When I have been logged in for a while (via an admin account), the routes are not available to me unless I sign out and re-login.
(When this happens, UI shows that I am logged)
Does this have something to do the session token expiry time?
If this is the case, is there any workaround this such as prompting the users to the login again?
Any insight would be appreciated.
EDIT - Additional Info
From my understanding, Admin-only features such as reporting/deleting messages, banning accounts etc works without prompting me to a login even after I've been logged in for a while. However, the routes that I add in the plugin I develop don't seem to behave the same way