Skip to content

Commit 5acb61e

Browse files
committed
new EU-logon, ccs2 functions
1 parent 8003885 commit 5acb61e

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/controllers/authStrategies/european.brandAuth.strategy.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,21 @@ export class EuropeanBrandAuthStrategy implements AuthStrategy {
4848
});
4949

5050
const authUrl = `${this.environment.idpUrl}/auth/api/v2/user/oauth2/authorize`;
51-
const params = {
51+
await got(authUrl, {
5252
response_type: 'code',
5353
client_id: serviceId,
54-
redirect_uri: this.environment.endpoints.redirectUri, // `${this.environment.baseUrl}/api/v1/user/oauth2/redirect`,
54+
redirect_uri: this.environment.endpoints.redirectUri,
5555
state: 'ccsp',
5656
lang: 'en'
57-
};
58-
await got(authUrl, { params });
57+
});
5958

6059
const loginUrl = `${this.environment.idpUrl}/auth/account/signin`;
6160
const loginData = new URLSearchParams({
6261
username: user.username,
6362
password: user.password,
6463
encryptedPassword: 'false',
6564
remember_me: 'false',
66-
redirect_uri: this.environment.endpoints.redirectUri, // `${this.environment.baseUrl}/api/v1/user/oauth2/redirect`,
65+
redirect_uri: this.environment.endpoints.redirectUri,
6766
state: 'ccsp',
6867
client_id: this.environment.clientId
6968
});
@@ -87,7 +86,7 @@ export class EuropeanBrandAuthStrategy implements AuthStrategy {
8786
const code = parsedUrl.searchParams.get('code');
8887

8988
if (!code) {
90-
throw new Error(`@EuropeanBrandAuthStrategy.login: Cannot find the argument code in ${body.redirectUrl}.`);
89+
throw new Error(`@EuropeanBrandAuthStrategy.login: Cannot find the argument code.`);
9190
}
9291
return {
9392
code: code as Code,

0 commit comments

Comments
 (0)