Make it possible to pass dynamic redirect url as query parameter

Can you do the assignment above the `if`?