Show message when session is over and redirect to login page

Hello, my application is using Angular + Spring Boot and keycloack in the authentication part. There’s 300 seconds to end my session after I make the login, how can i show a message showing to the user that session is over and redirect to login page.