# Preventing automatic login after registration email verification

**URL:** <https://forum.keycloak.org/t/preventing-automatic-login-after-registration-email-verification/13371>\
**Category:** Configuring the server\
**Created:** [February 1, 2022, 3:48pm UTC](https://forum.keycloak.org/t/preventing-automatic-login-after-registration-email-verification/13371 "2022-02-01T15:48:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![charlies96](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/charlies96/32/4941_2.png) [@charlies96](https://forum.keycloak.org/u/charlies96)\
**Post date:** [February 1, 2022, 3:48pm UTC](https://forum.keycloak.org/t/preventing-automatic-login-after-registration-email-verification/13371/1 "2022-02-01T15:48:05Z")

</div>

Hello,  
We have enabled email verification on Keycloak, meaning a user receives an email after the registration flow has been completed. Once the user clicks on the link in the email, they are automatically logged in and thus a keycloak session is automatically initiated. We want to customize this flow and stop this automatic login, yet I can’t find a flow for the email verification on the Console. Is anyone aware of how to do this?

Thanks,  
Charlie

---

<div class="post-metadata">

**Author:** ![xgp](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/xgp/32/2589_2.png) [@xgp](https://forum.keycloak.org/u/xgp)\
**Post date:** [February 1, 2022, 3:55pm UTC](https://forum.keycloak.org/t/preventing-automatic-login-after-registration-email-verification/13371/2 "2022-02-01T15:55:42Z")

</div>

Email verification is executed in Keycloak by something called an `ActionTokenHandler`. Specifically: [keycloak/VerifyEmailActionTokenHandler.java at main · keycloak/keycloak · GitHub](https://github.com/keycloak/keycloak/blob/main/services/src/main/java/org/keycloak/authentication/actiontoken/verifyemail/VerifyEmailActionTokenHandler.java)

In order to change the behavior of this handler, you would have to extend it, and the implement your own `RequiredAction` for initiating the process.
