I am using keycloak's login and registration page. For login I use: keycloak.init({onLoad: 'login-required'}).then(function (authenticated) { if (!…