Add OTP login page and auth guard for client cabinet

This commit is contained in:
Ruslan Bakiev
2026-04-01 19:10:18 +07:00
parent b4537c1483
commit 1c4fd847dc
9 changed files with 605 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ export default defineEventHandler(async (event) => {
const body = await readBody(event);
const cookie = getHeader(event, 'cookie');
const authorization = getHeader(event, 'authorization');
const userId = getHeader(event, 'x-user-id');
const response = await fetch(config.backendGraphqlUrl, {
@@ -10,6 +11,7 @@ export default defineEventHandler(async (event) => {
headers: {
'content-type': 'application/json',
...(cookie ? { cookie } : {}),
...(authorization ? { authorization } : {}),
...(userId ? { 'x-user-id': userId } : {}),
},
body: JSON.stringify(body),