forbids login on social provider (google) /callback after hook

Hi, I'm trying to check for user active/inactive status and prevent them from logging in.

So far I can throw an error after checking their user data on /callback:id after hook. However, I want it to gracefully redirect user to our signin page and show an error, this can be done by redirecting user to /signin?error=abc

I can't figure out how to perform redirect and also clear the session tokens that are set on the response header's 'set-cookie'

I have tried:
  1. Performing ctx.setCookie to clear the cookies
  2. ctx.context.setNewSession(null)
  3. Overriding ctx.context.returned headers
  4. Overriding ctx.context.responseHeaders
  5. use throw ctx.redirect to redirect
  6. awaited call on ctx.context.internalAdapter.deleteSession
  7. throw new APIError
None of the above worked for me and I'm out of ideas right now.

Option 3 and 7 prevented the redirect, but the session tokens are still set
Was this page helpful?