Fixed issue with return to cookie (#828)

This commit is contained in:
Ahmad Farhat 2019-10-10 16:24:35 -04:00 committed by Jesus Federico
parent 49def8f405
commit b9dcaa1b18
1 changed files with 3 additions and 1 deletions

View File

@ -17,7 +17,9 @@
$(document).on('turbolinks:load', function(){
// Stores the current url when the user clicks the sign in button
$(".sign-in-button").click(function(){
var url = [location.protocol, '//', location.host, location.pathname].join('');
var url = location.href
// Add the slash at the end if it's missing
url += url.endsWith("/") ? "" : "/"
document.cookie ="return_to=" + url
})