Skip to content

Commit 6157255

Browse files
committed
Use querystring for authorize url
1 parent dc10228 commit 6157255

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

lib/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,13 @@ class NetatmoClient {
8888
throw new Error('Redirect url must be provided')
8989
}
9090
this.state = statePrefix + Math.random() * 10000000000000000
91-
return `${baseURL}/oauth2/authorize?client_id=${this.clientId}&redirect_uri=${this.redirectUrl}&scope=${this.scope}&state=${this.state}`
91+
const query = querystring.stringify({
92+
client_id: this.clientId,
93+
redirect_uri: this.redirectUrl,
94+
scope: this.scope,
95+
state: this.state,
96+
})
97+
return `${baseURL}/oauth2/authorize?${query}`
9298
}
9399

94100
/**

0 commit comments

Comments
 (0)