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

Fixes HttpError and AuthError instanceof bug #1648

Merged
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
1 change: 1 addition & 0 deletions waspc/data/Generator/templates/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"exports": {
"./core/HttpError": "./core/HttpError.js",
"./core/AuthError": "./core/AuthError.js",
"./core/config": "./core/config.js",
"./core/stitches.config": "./core/stitches.config.js",
"./core/storage": "./core/storage.ts",
Expand Down
2 changes: 1 addition & 1 deletion waspc/data/Generator/templates/server/src/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import express from 'express'

import HttpError from './core/HttpError.js'
import HttpError from 'wasp/core/HttpError'
import indexRouter from './routes/index.js'

// TODO: Consider extracting most of this logic into createApp(routes, path) function so that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { ensureValidEmail } from "../../validation.js";
import type { EmailFromField } from '../../../email/core/types.js';
import { GetPasswordResetEmailContentFn } from './types.js';
import HttpError from '../../../core/HttpError.js';
import HttpError from 'wasp/core/HttpError'

export function getRequestPasswordResetRoute({
fromField,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from "../../utils.js";
import { ensureTokenIsPresent, ensurePasswordIsPresent, ensureValidPassword } from "../../validation.js";
import { tokenVerificationErrors } from "./types.js";
import HttpError from '../../../core/HttpError.js';
import HttpError from 'wasp/core/HttpError';

export async function resetPassword(
req: Request<{ token: string; password: string; }>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
import { ensureValidEmail, ensureValidPassword, ensurePasswordIsPresent } from "../../validation.js";
import { GetVerificationEmailContentFn } from './types.js';
import { validateAndGetUserFields } from '../../utils.js'
import HttpError from '../../../core/HttpError.js';
import HttpError from 'wasp/core/HttpError';
import { type UserSignupFields } from '../types.js';

export function getSignupRoute({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
deserializeAndSanitizeProviderData,
} from '../../utils.js';
import { tokenVerificationErrors } from './types.js';
import HttpError from '../../../core/HttpError.js';
import HttpError from 'wasp/core/HttpError';


export async function verifyEmail(
Expand Down
4 changes: 2 additions & 2 deletions waspc/data/Generator/templates/server/src/auth/utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{={= =}=}}
import { hashPassword } from './password.js'
import { verify } from './jwt.js'
import AuthError from '../core/AuthError.js'
import HttpError from '../core/HttpError.js'
import AuthError from 'wasp/core/AuthError'
import HttpError from 'wasp/core/HttpError'
import prisma from '../dbClient.js'
import { sleep } from '../utils.js'
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import HttpError from '../core/HttpError.js';
import HttpError from 'wasp/core/HttpError'

export const PASSWORD_FIELD = 'password';
const USERNAME_FIELD = 'username';
Expand Down
17 changes: 0 additions & 17 deletions waspc/data/Generator/templates/server/src/core/AuthError.js

This file was deleted.

22 changes: 0 additions & 22 deletions waspc/data/Generator/templates/server/src/core/HttpError.js

This file was deleted.

2 changes: 0 additions & 2 deletions waspc/src/Wasp/Generator/ServerGenerator.hs
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,6 @@ genSrcDir :: AppSpec -> Generator [FileDraft]
genSrcDir spec =
sequence
[ genFileCopy [relfile|app.js|],
genFileCopy [relfile|core/AuthError.js|],
genFileCopy [relfile|core/HttpError.js|],
genDbClient spec,
genConfigFile spec,
genServerJs spec,
Expand Down
Loading