Skip to content

Commit

Permalink
[skip ci] prettier fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dromzeh committed Aug 1, 2023
1 parent 1bb24e7 commit 0c6a109
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/routes/auth/login.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { auth } from "@/lib/auth/lucia";
import type { LoginBody } from "@/lib/types/auth";
import { responseHeaders } from "@/lib/responseHeaders";
import "lucia/polyfill/node" // required for old node versions
import "lucia/polyfill/node"; // required for old nodejs versions

export const login = async (request: Request): Promise<Response> => {
const body = (await request.json()) as LoginBody;
const { username, password } = body;

// TODO: in-depth error handling

if (!username || !password) {
return new Response(
JSON.stringify({
Expand Down
2 changes: 2 additions & 0 deletions src/routes/auth/signup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export const signup = async (request: Request): Promise<Response> => {
const body = (await request.json()) as RegisterBody;
const { username, password, email, passwordConfirm } = body;

// TODO: in-depth error handling

if (!username || !password || !email || !passwordConfirm) {
return new Response(
JSON.stringify({
Expand Down
2 changes: 2 additions & 0 deletions src/routes/auth/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export const validate = async (request: Request): Promise<Response> => {
const authRequest = auth.handleRequest(request);
const session = await authRequest.validate();

// TODO: in-depth error handling

if (!session) {
return new Response(
JSON.stringify({
Expand Down

0 comments on commit 0c6a109

Please sign in to comment.