Rearranged routes, added referrer after login