Actions: how to set the httpcode of the response?

I am trying to disallow oauth/token for users with unverified email, using the following Login/Post login Action:

exports.onExecutePostLogin = async (event, api) => {
  if (!event.user.email_verified) {
    api.access.deny(`Email verification needed.`);

The problem is that now the endpoint returns an http code 500 and I cannot find how to change it

Thanks in advance!

Hey there @bruno.crisafulli !

Unfortunately this isn’t currently possible, though I agree this would be nice. Please see the following post:

It might be worth adding your input to the following feedback request!


Ok thanks for answering. I voted and commented on the feedback request you linked.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.