Skip to content

Commit c55df72

Browse files
committed
fix: commonjs issues for migration when running production image
1 parent 9717c27 commit c55df72

11 files changed

Lines changed: 31 additions & 57 deletions

.github/FUNDING.yml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1 @@
1-
# These are supported funding model platforms
2-
3-
github: @fells-code
4-
patreon: # Replace with a single Patreon username
5-
open_collective: # Replace with a single Open Collective username
6-
ko_fi: # Replace with a single Ko-fi username
7-
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9-
liberapay: # Replace with a single Liberapay username
10-
issuehunt: # Replace with a single IssueHunt username
11-
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12-
polar: # Replace with a single Polar username
13-
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
14-
thanks_dev: # Replace with a single thanks.dev username
15-
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
1+
github: "@fells-code"

.sequelizerc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
require('dotenv').config();
2-
31
const path = require('path');
42

53
module.exports = {

package-lock.json

Lines changed: 9 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
"@typescript-eslint/eslint-plugin": "^8.46.2",
7676
"@typescript-eslint/parser": "^8.46.2",
7777
"@vitest/coverage-v8": "^4.0.18",
78-
"dotenv": "^16.4.5",
7978
"eslint": "^10.0.1",
8079
"eslint-config-prettier": "^10.1.8",
8180
"eslint-plugin-prettier": "^5.5.4",
@@ -90,4 +89,4 @@
9089
"typescript-eslint": "^8.56.0",
9190
"vitest": "^4.0.3"
9291
}
93-
}
92+
}

src/controllers/magicLinks.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,18 +166,18 @@ export async function pollMagicLinkConfirmation(req: Request, res: Response) {
166166

167167
if (!record) {
168168
console.log('No magic link token');
169-
return res.status(500).json({ error: 'Invalid request' });
169+
return res.status(500).json({ message: 'Invalid request' });
170170
}
171171

172172
// Device binding check
173173
const { ip_hash, user_agent_hash } = hashDeviceFingerprint(req.ip, req.headers['user-agent']);
174174

175175
if (record.ip_hash && record.ip_hash !== ip_hash) {
176-
return res.status(500).json({ error: 'Invalid request' });
176+
return res.status(500).json({ message: 'Invalid request' });
177177
}
178178

179179
if (record.user_agent_hash && record.user_agent_hash !== user_agent_hash) {
180-
return res.status(500).json({ error: 'Invalid request' });
180+
return res.status(500).json({ message: 'Invalid request' });
181181
}
182182

183183
if (record.used_at && record.expires_at > new Date()) {
@@ -241,5 +241,5 @@ export async function pollMagicLinkConfirmation(req: Request, res: Response) {
241241
}
242242
}
243243

244-
return res.status(204).json({ error: 'Not verified.' });
244+
return res.status(204).json({ message: 'Not verified.' });
245245
}
File renamed without changes.
File renamed without changes.

src/routes/magicLink.routes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ magicLinkRouter.get(
4848
response: {
4949
200: MagicLinkPollSuccessSchema,
5050
204: MagicLinkPollPendingSchema,
51+
404: MagicLinkPollPendingSchema,
5152
500: MagicLinkErrorSchema,
5253
},
5354
},

src/schemas/magiclink.responses.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ export const MagicLinkRequestResponseSchema = z.object({
55
});
66

77
export const MagicLinkVerifyResponseSchema = z.object({
8-
message: z.literal('Success'),
8+
message: z.string(),
99
});
1010

1111
export const MagicLinkPollSuccessSchema = z.object({
12-
message: z.literal('Success'),
12+
message: z.string(),
1313
token: z.string().optional(),
1414
refreshToken: z.string().optional(),
1515
sub: z.string().optional(),

src/server.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
* Copyright © 2026 Fells Code, LLC
33
* Licensed under the GNU Affero General Public License v3.0
44
*/
5-
import 'dotenv/config';
6-
75
import { Application } from 'express';
86

97
import { createApp } from './app.js';

0 commit comments

Comments
 (0)