'Angular 10 JWT asp.net core display user online status realtime
Im using angular 10 as my frontend and asp.net core as my backend. I use jwt as my user authentication method. User posts its username and password to the server side and server generates a token sending it back to the user. And I save the token in user's browser local storage. I have written an http interceptor which adds authorization bearer to the header section of user's api requests. This is the way server knows who is who. Now I have a page in which I should display online and offline users with green and red dots next to their names. I can know when a user signs in because it has to login and I can do whateverI want when user signs in but I dont know how to let my client know when users close their browser and leave the site. I am looking for any library, logic or anything to know my user's online/offline status realtime. I should display which users are online and which are not and it should be realtime. I use microsoft identity context to handle membership. Any help is appreciated. Thank you. I need to add that I want a solution rather than code. I just want to know how to do it. I can handle the code work myself. I just want to know how?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
