Fix successful login redirection to keep parameters

Login screen accept a token to redirect to on successful login but
if the token contained parameters, they were dropped.

Encode/decode the token to fix this issue.

When a URL has a pound sign, it is included in the token as well.
This removes the hardcoded behaviour to include a pound sign in every
redirect URL. Will now be able to use login redirection for URLs with
no pound sign (e.g. GitWeb)

Change-Id: If8a74a74ce11f79389895e4d036b06a1e81abbe5
8 files changed