refactor(auth): standardize session management and security
- Centralize secret retrieval using `getAdminSessionSecret` - Replace manual session parsing with `verifyRequestAdminSession` utility - Tighten API validation and improve security headers handling - Enforce environment variable security for production deployments
This commit is contained in:
1 parent
34519c07df
commit
177ed4a844
78 files changed
+6748
-3157
No files matched your search
+13
-1
@@ -23,7 +23,19 @@ export async function GET(req: NextRequest) {
|
||||
);
|
||||
}
|
||||
|
||||
const clientId = verified.payload.clientId;
|
||||
const clientId = String(verified.payload.clientId || '')
|
||||
.trim()
|
||||
.toLowerCase();
|
||||
if (SDKManager.isClientDeleted(clientId)) {
|
||||
return NextResponse.json(
|
||||
{
|
||||
status: 'error',
|
||||
code: 'CLIENT_REVOKED',
|
||||
error: `CLIENT_REVOKED: Client '${clientId}' has been deleted by administrator.`,
|
||||
},
|
||||
{ status: 403 },
|
||||
);
|
||||
}
|
||||
const registeredClient = await SDKManager.getClientAsync(clientId);
|
||||
if (registeredClient) {
|
||||
if (registeredClient.status === 'revoked') {
|
||||
|
||||
Reference in new issue
Block a user