Ugly hack to keep the previous uri for returning after login