in auth-sessions/script.js [72:91]
const handleSignedInUser = function(user) {
// Show redirection notice.
document.getElementById('redirecting').classList.remove('hidden');
// Set session cookie
user.getIdToken().then(function(idToken) {
// Session login endpoint is queried and the session cookie is set.
// CSRF token should be sent along with request.
const csrfToken = getCookie('csrfToken')
return postIdTokenToSessionLogin('/sessionLogin', idToken, csrfToken)
.then(function() {
// Redirect to profile on success.
window.location.assign('/profile');
}, function(error) {
// Refresh page on error.
// In all cases, client side state should be lost due to in-memory
// persistence.
window.location.assign('/');
});
});
};