Skip to content

chore: lock file maintenance #11039

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe('example-passport-login acceptance test', () => {
password: 'password',
})
.expect(302);
const setCookie: string[] = response.get('Set-Cookie');
const setCookie: string[] = response.get('Set-Cookie') ?? [];
if (setCookie?.length) {
Cookie = setCookie[0].split(';')[0];
}
Expand All @@ -127,7 +127,7 @@ describe('example-passport-login acceptance test', () => {
/**
* replace existing cookie with cookie from logout response
*/
const setCookie: string[] = response.get('Set-Cookie');
const setCookie: string[] = response.get('Set-Cookie') ?? [];
if (setCookie?.length) {
Cookie = setCookie[0].split(';')[0];
}
Expand Down Expand Up @@ -180,15 +180,15 @@ describe('example-passport-login acceptance test', () => {
const response = await client
.get('/api/auth/thirdparty/oauth2')
.expect(303);
oauthProviderUrl = response.get('Location');
oauthProviderUrl = response.get('Location') ?? '';
expect(url.parse(oauthProviderUrl).pathname).to.equal('/oauth/dialog');
});

it('call to authorization url is redirected to oauth providers login page', async () => {
const response = await supertest('').get(oauthProviderUrl).expect(302);
providerLoginUrl = response.get('Location');
providerLoginUrl = response.get('Location') ?? '';
loginPageParams = url.parse(providerLoginUrl).query ?? '';
expect(url.parse(response.get('Location')).pathname).to.equal('/login');
expect(url.parse(providerLoginUrl).pathname).to.equal('/login');
});

/**
Expand All @@ -215,7 +215,7 @@ describe('example-passport-login acceptance test', () => {
.post('/login_submit')
.send(qs.stringify(params))
.expect(302);
callbackToLbApp = response.get('Location');
callbackToLbApp = response.get('Location') ?? '';
expect(url.parse(callbackToLbApp).pathname).to.equal(
'/api/auth/thirdparty/oauth2/callback',
);
Expand All @@ -230,7 +230,7 @@ describe('example-passport-login acceptance test', () => {
.get(url.parse(callbackToLbApp).path ?? '')
.expect(302);
expect(response.get('Location')).to.equal('/auth/account');
const setCookie: string[] = response.get('Set-Cookie');
const setCookie: string[] = response.get('Set-Cookie') ?? [];
if (setCookie?.length) {
Cookie = setCookie[0].split(';')[0];
}
Expand All @@ -253,7 +253,7 @@ describe('example-passport-login acceptance test', () => {
/**
* replace existing cookie with cookie from logout response
*/
const setCookie: string[] = response.get('Set-Cookie');
const setCookie: string[] = response.get('Set-Cookie') ?? [];
if (setCookie?.length) {
Cookie = setCookie[0].split(';')[0];
}
Expand Down Expand Up @@ -298,7 +298,7 @@ describe('example-passport-login acceptance test', () => {
const response = await client
.get('/api/auth/thirdparty/facebook')
.expect(303);
oauthProviderUrl = response.get('Location');
oauthProviderUrl = response.get('Location') ?? '';
expect(url.parse(oauthProviderUrl).pathname).to.equal(
'/oauth/dialog',
);
Expand All @@ -308,11 +308,9 @@ describe('example-passport-login acceptance test', () => {
const response = await supertest('')
.get(oauthProviderUrl)
.expect(302);
providerLoginUrl = response.get('Location');
providerLoginUrl = response.get('Location') ?? '';
loginPageParams = url.parse(providerLoginUrl).query ?? '';
expect(url.parse(response.get('Location')).pathname).to.equal(
'/login',
);
expect(url.parse(providerLoginUrl).pathname).to.equal('/login');
});

/**
Expand All @@ -339,7 +337,7 @@ describe('example-passport-login acceptance test', () => {
.post('/login_submit')
.send(qs.stringify(params))
.expect(302);
callbackToLbApp = response.get('Location');
callbackToLbApp = response.get('Location') ?? '';
expect(url.parse(callbackToLbApp).pathname).to.equal(
'/api/auth/thirdparty/facebook/callback',
);
Expand All @@ -354,7 +352,7 @@ describe('example-passport-login acceptance test', () => {
.get(url.parse(callbackToLbApp).path ?? '')
.expect(302);
expect(response.get('Location')).to.equal('/auth/account');
const setCookie: string[] = response.get('Set-Cookie');
const setCookie: string[] = response.get('Set-Cookie') ?? [];
if (setCookie?.length) {
Cookie = setCookie[0].split(';')[0];
}
Expand All @@ -377,7 +375,7 @@ describe('example-passport-login acceptance test', () => {
/**
* replace existing cookie with cookie from logout response
*/
const setCookie: string[] = response.get('Set-Cookie');
const setCookie: string[] = response.get('Set-Cookie') ?? [];
if (setCookie?.length) {
Cookie = setCookie[0].split(';')[0];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ describe('Oauth2 authorization flow', () => {
// HTTP status code 303 means see other,
// on seeing which the browser would redirect to the other location
const response = await client.get('/auth/thirdparty').expect(303);
oauthProviderUrl = response.get('Location');
expect(url.parse(response.get('Location')).pathname).to.equal(
oauthProviderUrl = response.get('Location') ?? '';
expect(url.parse(oauthProviderUrl).pathname).to.equal(
url.parse(oauth2Options.authorizationURL).pathname,
);
});
Expand All @@ -195,9 +195,9 @@ describe('Oauth2 authorization flow', () => {
// HTTP status code 302 means redirect to new uri,
// on seeing which the browser would redirect to the new uri
const response = await supertest('').get(oauthProviderUrl).expect(302);
providerLoginUrl = response.get('Location');
providerLoginUrl = response.get('Location') ?? '';
loginPageParams = url.parse(providerLoginUrl).query ?? '';
expect(url.parse(response.get('Location')).pathname).to.equal('/login');
expect(url.parse(providerLoginUrl).pathname).to.equal('/login');
});

it('login page redirects to authorization app callback endpoint', async () => {
Expand All @@ -217,7 +217,7 @@ describe('Oauth2 authorization flow', () => {
.post('/login_submit')
.send(qs.stringify(params))
.expect(302);
callbackToLbApp = response.get('Location');
callbackToLbApp = response.get('Location') ?? '';
expect(url.parse(callbackToLbApp).pathname).to.equal(
'/auth/thirdparty/callback',
);
Expand Down
Loading
Loading