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