Can now go directly to /profilepage and be redirected to /login instead of getting an error due tto an undefined request object.