Skip to content
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

Fix authentication on backend #20

Merged
merged 1 commit into from
Dec 1, 2024
Merged
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
4 changes: 3 additions & 1 deletion src/controllers/Dashboard.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import type { Request, Response } from 'express';
* @param res - the response object
*/
export const getDashboardStats = async (req: Request, res: Response) => {
const base = new Airtable({ apiKey: process.env.AIRTABLE_API_KEY || '' }).base(process.env.AIRTABLE_BASE_ID || '');
const base = new Airtable({ apiKey: process.env.AIRTABLE_API_KEY || '' }).base(
process.env.AIRTABLE_BASE_ID || ''
);

try {
await base('Data Table')
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/User.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
return res.status(400).send('Airtable ID is required');
}

if (process.env.ENVIRONMENT !== 'test') {
if (true /*process.env.ENVIRONMENT !== 'test'*/) {

Check failure on line 95 in src/controllers/User.controller.ts

View workflow job for this annotation

GitHub Actions / eslint-check (19.x)

Unexpected constant condition
try {
await clerkClient.users.updateUserMetadata(req.auth.userId || '', {
publicMetadata: {
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/validateAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
next: NextFunction
) => {
// If the environment is not test, use ClerkExpressWithAuth to validate the user's session
if (process.env.ENVIRONMENT !== 'test') {
if (true /*process.env.ENVIRONMENT !== 'test'*/) {

Check failure on line 24 in src/middleware/validateAuth.ts

View workflow job for this annotation

GitHub Actions / eslint-check (19.x)

Unexpected constant condition
// Use ClerkExpressWithAuth to validate the user's session then call next() if the user is authenticated
ClerkExpressWithAuth({})(req, res, async () => {
if (req.auth.sessionId && req.auth.userId) {
Expand Down
Loading