Skip to content

Commit 71b53b2

Browse files
committed
Change cookies' attributes
1 parent caaf1d9 commit 71b53b2

File tree

5 files changed

+11
-93
lines changed

5 files changed

+11
-93
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Envs
77

8-
.env
8+
.env*
99

1010
# Logs
1111
logs

.staging.env

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/auth/auth.controller.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ export class AuthController {
4848
// expire the token from the db because the expiration time of the tokens are rather long
4949
res.clearCookie('auth', {
5050
httpOnly: true,
51-
sameSite: process.env.NODE_ENV === 'staging' ? 'none' : 'lax',
51+
// sameSite: process.env.NODE_ENV === 'staging' ? 'none' : 'lax',
5252
domain:
53-
process.env.NODE_ENV === 'staging'
54-
? 'pairwise.iran.liara.run'
55-
: undefined,
53+
process.env.NODE_ENV === 'development'
54+
? undefined
55+
: 'pairwise.generalmagic.io',
5656
secure: true,
5757
});
5858
res.send('Logged out.');
@@ -92,11 +92,11 @@ export class AuthController {
9292

9393
res.cookie('auth', nonce, {
9494
httpOnly: true,
95-
sameSite: process.env.NODE_ENV === 'staging' ? 'none' : 'lax',
95+
// sameSite: process.env.NODE_ENV === 'staging' ? 'none' : 'lax',
9696
domain:
97-
process.env.NODE_ENV === 'staging'
98-
? 'pairwise.iran.liara.run'
99-
: undefined,
97+
process.env.NODE_ENV === 'development'
98+
? undefined
99+
: 'pairwise.generalmagic.io',
100100
secure: true,
101101
expires: new Date(Date.now() + this.authService.TokenExpirationDuration),
102102
});

src/auth/auth.service.ts

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -93,84 +93,4 @@ export class AuthService {
9393
return false;
9494
}
9595
};
96-
97-
// async login(
98-
// email: string,
99-
// password: string,
100-
// twoFAToken?: string,
101-
// ): Promise<UserAuthToken> {
102-
// const user = await this.usersService.findOne({
103-
// where: { email },
104-
// include: { artist: true },
105-
// });
106-
107-
// if (!user) {
108-
// throw new NotFoundException(`No user found for email: ${email}`);
109-
// }
110-
111-
// if (user.status === UserStatus.RESTRICTED) {
112-
// throw new UnauthorizedException('Your account is inactive');
113-
// } else if (user.status === UserStatus.DELETED) {
114-
// throw new UnauthorizedException('Your account is deleted');
115-
// }
116-
117-
// const passwordValid = await Utils.validatePassword(password, user.password);
118-
119-
// if (user.twoFASecret) {
120-
// if (!twoFAToken) {
121-
// throw new UnauthorizedException('Two factor authentication required');
122-
// } else {
123-
// if (!this.isTwoFACodeValid(twoFAToken, user)) {
124-
// throw new BadRequestException(
125-
// 'Invalid two factor authentication token',
126-
// );
127-
// }
128-
// }
129-
// }
130-
131-
// if (!passwordValid) {
132-
// throw new BadRequestException('Invalid password');
133-
// }
134-
135-
// if (isEmailNotVerified(user.status)) {
136-
// await this.requestEmailVerification(email);
137-
// }
138-
139-
// return {
140-
// ...this.generateTokens({
141-
// user_id: user.id,
142-
// }),
143-
// user,
144-
// };
145-
// }
146-
147-
// getUserFromToken(token: string): Promise<User> {
148-
// const decodedToken = this.jwtService.decode(token);
149-
150-
// if (!decodedToken) {
151-
// throw new BadRequestException('Invalid token');
152-
// }
153-
154-
// return this.usersService.findOne({
155-
// where: { id: decodedToken['user_id'] },
156-
// include: { artist: true },
157-
// });
158-
// }
159-
160-
// private generateAccessToken(payload: { user_id: string }): string {
161-
// const securityConfig = this.configService.get<SecurityConfig>('security');
162-
// // TODO: Check if this is how to do this. This doesn't match the template
163-
// return this.jwtService.sign(payload, {
164-
// secret: securityConfig.jwt_access_secret,
165-
// expiresIn: securityConfig.expiresIn,
166-
// });
167-
// }
168-
169-
// private generateRefreshToken(payload: { user_id: string }): string {
170-
// const securityConfig = this.configService.get<SecurityConfig>('security');
171-
// return this.jwtService.sign(payload, {
172-
// secret: securityConfig.jwt_refresh_secret,
173-
// expiresIn: securityConfig.refreshIn,
174-
// });
175-
// }
17696
}

src/flow/flow.controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ export class FlowController {
8686
pairs = await this.flowService.getCollectionPairs(
8787
userId,
8888
collectionId,
89-
3,
89+
1,
9090
);
9191
else if (collectionId && type === 'project')
92-
pairs = await this.flowService.getProjectPairs(userId, collectionId, 3);
92+
pairs = await this.flowService.getProjectPairs(userId, collectionId, 1);
9393
else pairs = [] as any;
9494

9595
return pairs;

0 commit comments

Comments
 (0)