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:
Option 3 and 7 prevented the redirect, but the session tokens are still set
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:
- Performing ctx.setCookie to clear the cookies
- ctx.context.setNewSession(null)
- Overriding ctx.context.returned headers
- Overriding ctx.context.responseHeaders
- use throw ctx.redirect to redirect
- awaited call on ctx.context.internalAdapter.deleteSession
- throw new APIError
Option 3 and 7 prevented the redirect, but the session tokens are still set