260324_01_ENH: 로그인 response types/auth로 이동
This commit is contained in:
@@ -1,14 +1,9 @@
|
||||
import {createBackApi} from "@/lib/server-api";
|
||||
import {LoginRequest, LoginUser} from "@/types/auth";
|
||||
import {LoginRequest, LoginResponse, LoginUser} from "@/types/auth";
|
||||
import {NextRequest, NextResponse} from "next/server";
|
||||
import {serverEnv} from "@/lib/env.server";
|
||||
import {errorToResponse} from "@/lib/http-util";
|
||||
|
||||
type LoginResponse = {
|
||||
accessToken: string;
|
||||
user: LoginUser;
|
||||
};
|
||||
|
||||
export const POST = async (req: NextRequest) => {
|
||||
try {
|
||||
const backApi = await createBackApi();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type {ProductResponse, StatisticsRequest} from "@/types/lg";
|
||||
import type {StatisticsRequest} from "@/types/lg";
|
||||
|
||||
const sortRecord = <T,>(obj?: Record<string, T> | null): Record<string, T> => {
|
||||
if (!obj) return {};
|
||||
|
||||
@@ -3,6 +3,11 @@ export type LoginRequest = {
|
||||
userPw: string;
|
||||
};
|
||||
|
||||
export type LoginResponse = {
|
||||
accessToken: string;
|
||||
user: LoginUser;
|
||||
};
|
||||
|
||||
export type LoginUser = {
|
||||
userId: string;
|
||||
userName: string;
|
||||
|
||||
Reference in New Issue
Block a user