fix(apple auth): add needed env var to client and encode redirect url

This commit is contained in:
Matteo Pagliazzi
2020-04-18 17:41:25 +02:00
parent 9f9da5632d
commit 2d9715b657
2 changed files with 2 additions and 1 deletions

View File

@@ -23,6 +23,6 @@ export function setUpAxios (AUTH_SETTINGS) { // eslint-disable-line import/prefe
}
export function buildAppleAuthUrl () {
const redirectUrl = `${window.location.protocol}//${window.location.host}/api/v4/user/auth/apple`;
const redirectUrl = encodeURIComponent(`${window.location.protocol}//${window.location.host}/api/v4/user/auth/apple`);
return `https://appleid.apple.com/auth/authorize?response_mode=form_post&scope=name%20email&response_type=code&version=2&redirect_uri=${redirectUrl}&client_id=${process.env.APPLE_AUTH_CLIENT_ID}`;
}