I’m using an action to try redirect away from an admin page and to a standard user profile if you don’t have an ‘admin’ role. So anyone with a ‘user’ role should be directed to a normal profile page.
But when I try this…
exports.onExecutePostLogin = async (event, api) => {
if (event.authorization.roles.includes("user")) {
api.redirect.sendUserTo("http://localhost:3000/user/profile")
};
};
My page just says “got redirected too many times” and crashes the app. It’s like an endless redirect loop
How do you implement a redirect like this based on roles?