update api and login

This commit is contained in:
2026-09-29 00:44:48 +05:30
parent b36a30385c
commit 2d8739e9a4
50 changed files with 2044 additions and 986 deletions

View File

@@ -1,5 +1,6 @@
import type {NextRequest} from 'next/server';
import {authApi} from '@/services/api/authApi';
import {refuseOffConsole} from '@/features/auth/services/serverSession';
import {serveUpstream} from '@/shared/services/bff';
import {toDeviceSession} from '@/features/settings/services/mapSession';
@@ -14,6 +15,8 @@ export const dynamic = 'force-dynamic';
* from the browser they are reading the page in.
*/
export async function GET(req: NextRequest) {
const refused = await refuseOffConsole();
if (refused) return refused;
return serveUpstream(req, (token) => authApi.sessions(token), (list) =>
list.map(toDeviceSession),
);