Fix wrong URL when joining team, and improve way to set redirect URL