Skip to content

Commit c4190dc

Browse files
committed
chore: remove unused reviewerGitAccount processing and fix getProxyUrl url processing
1 parent 233deac commit c4190dc

File tree

2 files changed

+6
-21
lines changed

2 files changed

+6
-21
lines changed

src/service/routes/push.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,6 @@ router.post('/:id/authorise', async (req: Request, res: Response) => {
128128
if (isAllowed) {
129129
console.log(`user ${username} approved push request for ${id}`);
130130

131-
const reviewerList = await db.getUsers({ username });
132-
console.log({ reviewerList });
133-
134-
const reviewerGitAccount = reviewerList[0].gitAccount;
135-
console.log({ reviewerGitAccount });
136-
137-
if (!reviewerGitAccount) {
138-
res.status(401).send({
139-
message: 'You must associate a GitHub account with your user before approving...',
140-
});
141-
return;
142-
}
143-
144131
const attestation = {
145132
questions,
146133
timestamp: new Date(),

src/service/urls.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@ import * as config from '../config';
66
const { GIT_PROXY_SERVER_PORT: PROXY_HTTP_PORT, GIT_PROXY_UI_PORT: UI_PORT } = serverConfig;
77

88
export const getProxyURL = (req: Request): string => {
9-
const defaultURL = `${req.protocol}://${req.headers.host}`.replace(
10-
`:${UI_PORT}`,
11-
`:${PROXY_HTTP_PORT}`,
9+
return (
10+
config.getDomains().proxy ??
11+
`${req.protocol}://${req.headers.host}`.replace(`:${UI_PORT}`, `:${PROXY_HTTP_PORT}`)
1212
);
13-
return (config.getDomains().proxy as string) ?? defaultURL;
1413
};
1514

1615
export const getServiceUIURL = (req: Request): string => {
17-
const defaultURL = `${req.protocol}://${req.headers.host}`.replace(
18-
`:${PROXY_HTTP_PORT}`,
19-
`:${UI_PORT}`,
16+
return (
17+
config.getDomains().service ??
18+
`${req.protocol}://${req.headers.host}`.replace(`:${PROXY_HTTP_PORT}`, `:${UI_PORT}`)
2019
);
21-
return (config.getDomains().service as string) ?? defaultURL;
2220
};

0 commit comments

Comments
 (0)