Allow redirects from logout/login route

Parse a query parameter containing a path to allow redirection after a login or logout.