Skip to content

Commit c190cde

Browse files
committed
address linting issues
1 parent 1cfcdbf commit c190cde

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

backend/typescript/rest/authRoutes.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ authRouter.post("/login", loginRequestValidator, async (req, res) => {
4343
.cookie("refreshToken", refreshToken, cookieOptions)
4444
.status(200)
4545
.json(rest);
46-
} catch (error) {
46+
} catch (error: unknown) {
4747
res.status(500).json({ error: getErrorMessage(error) });
4848
}
4949
});
@@ -63,14 +63,14 @@ authRouter.post(
6363
.status(200)
6464
.json(rest);
6565
}
66-
} catch (error) {
66+
} catch (error: unknown) {
6767
if (error instanceof NotFoundError) {
6868
res.status(404).send(getErrorMessage(error));
6969
} else {
7070
res.status(500).json({ error: getErrorMessage(error) });
7171
}
7272
}
73-
}
73+
},
7474
);
7575

7676
/* Returns access token in response body and sets refreshToken as an httpOnly cookie */
@@ -82,7 +82,7 @@ authRouter.post("/refresh", async (req, res) => {
8282
.cookie("refreshToken", token.refreshToken, cookieOptions)
8383
.status(200)
8484
.json({ accessToken: token.accessToken });
85-
} catch (error) {
85+
} catch (error: unknown) {
8686
res.status(500).json({ error: getErrorMessage(error) });
8787
}
8888
});
@@ -95,10 +95,10 @@ authRouter.post(
9595
try {
9696
await authService.revokeTokens(req.params.userId);
9797
res.status(204).send();
98-
} catch (error) {
98+
} catch (error: unknown) {
9999
res.status(500).json({ error: getErrorMessage(error) });
100100
}
101-
}
101+
},
102102
);
103103

104104
/* Emails a password reset link to the user with the specified email */
@@ -109,10 +109,10 @@ authRouter.post(
109109
try {
110110
await authService.resetPassword(req.params.email);
111111
res.status(204).send();
112-
} catch (error) {
112+
} catch (error: unknown) {
113113
res.status(500).json({ error: getErrorMessage(error) });
114114
}
115-
}
115+
},
116116
);
117117

118118
// updates user password and updates status
@@ -123,7 +123,7 @@ authRouter.post(
123123
try {
124124
const responseSuccess = await authService.setPassword(
125125
req.params.email,
126-
req.body.newPassword
126+
req.body.newPassword,
127127
);
128128
if (responseSuccess.success) {
129129
const user = await userService.getUserByEmail(req.params.email);
@@ -137,18 +137,18 @@ authRouter.post(
137137
} else {
138138
res.status(400).json(responseSuccess);
139139
}
140-
} catch (error) {
140+
} catch (error: unknown) {
141141
res.status(500).json({ error: getErrorMessage(error) });
142142
}
143-
}
143+
},
144144
);
145145

146146
/* Invite a user */
147147
authRouter.post("/invite-user", inviteUserDtoValidator, async (req, res) => {
148148
try {
149149
if (
150150
!isAuthorizedByRole(
151-
new Set([Role.ADMINISTRATOR, Role.ANIMAL_BEHAVIOURIST])
151+
new Set([Role.ADMINISTRATOR, Role.ANIMAL_BEHAVIOURIST]),
152152
)
153153
) {
154154
res
@@ -175,7 +175,7 @@ authRouter.post("/invite-user", inviteUserDtoValidator, async (req, res) => {
175175
await userService.updateUserById(user.id, invitedUser);
176176

177177
res.status(204).send();
178-
} catch (error) {
178+
} catch (error: unknown) {
179179
if (error instanceof NotFoundError) {
180180
res.status(404).send(getErrorMessage(error));
181181
} else {

backend/typescript/utilities/firebaseRestClient.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ type PasswordSignInResponse = {
1919
registered: boolean;
2020
};
2121

22-
2322
type RefreshTokenResponse = {
2423
expires_in: string;
2524
token_type: string;

frontend/src/APIClients/AuthAPIClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ const setPassword = async (
162162
export default {
163163
login,
164164
loginWithSignInLink,
165-
logout,
165+
logout,
166166
register,
167167
resetPassword,
168168
refresh,

0 commit comments

Comments
 (0)