# האם יש דרך להאזין לאירוע כניסת משתמש באמצעות רכיב Theme

**URL:** <https://meta.discourse.org/t/is-there-any-way-to-listen-user-login-event-using-theme-component/170976>\
**Category:** Development\
**Created:** [23 בנובמבר,‏ 2020,‏ 4:30am UTC](https://meta.discourse.org/t/is-there-any-way-to-listen-user-login-event-using-theme-component/170976 "2020-11-23T04:30:14Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Saurabh\_Khandelwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saurabh_khandelwal/32/156332_2.png) [@Saurabh\_Khandelwal](https://meta.discourse.org/u/Saurabh_Khandelwal)\
**Post date:** [23 בנובמבר,‏ 2020,‏ 4:30am UTC](https://meta.discourse.org/t/is-there-any-way-to-listen-user-login-event-using-theme-component/170976/1 "2020-11-23T04:30:14Z")

</div>

Hi All,

I want to display the Popup box using the Theme component when the User login first time.

**1.** I have tried to override the login action of the login controller using Theme component to display the Popup box while User successfully login.  
Here in the login action, I have added **bootbox.alert(“Test Alert”);** code before **hiddenLoginForm.submit();**.

But Popup is displayed until the hidderLoginForm is submitted and then redirected to the Home page.

> <https://github.com/discourse/discourse/blob/7af061fafa67bd332b4063a70ec34703df51431c/app/assets/javascripts/discourse/app/controllers/login.js#L226>

My requirement is Popup box should be displayed after redirecting to the Home page after successful login.

**2.** To check whether the User login for the first time I tried to check the value of the _ **previous\_visit\_at** _ property of the current user.  
If previous\_visit\_at = null (ie. The User is login for the first time.)  
But here also my test fails, as I login a second time the value of the _ **previous\_visit\_at** _ property was null.  
I want to know when exactly the value of _ **previous\_visit\_at** _ property is updated.

Please help me to achieve the above requirements

Thank you,  
Saurabh Khandelwal

---

_[View the full topic](https://meta.discourse.org/t/is-there-any-way-to-listen-user-login-event-using-theme-component/170976)._
