Skip to content

Commit

Permalink
Add encode uri params
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael Martins committed Nov 26, 2020
1 parent 6a22cb4 commit a7e82b9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/login-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,9 @@ export class LoginButton extends LitElement {
}

get linkUrl() {
let url = `https://www.teamwork.com/launchpad/login?redirect_uri=${this.redirectURI}&client_id=${this.clientID}`;
if (this.state) url = `${url}&state=${this.state}`;
const urlParam = (uri) => encodeURIComponent(uri);
let url = `https://www.teamwork.com/launchpad/login?redirect_uri=${urlParam(this.redirectURI)}&client_id=${urlParam(this.clientID)}`;
if (this.state) url = `${url}&state=${urlParam(this.state)}`;
return url;
}

Expand Down

0 comments on commit a7e82b9

Please sign in to comment.