1
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { type Request, type Response, Router } from 'express';
|
||||
import express, { type Request, type Response, Router } from 'express';
|
||||
import { z } from 'zod';
|
||||
|
||||
import type {
|
||||
@@ -28,6 +28,7 @@ import {
|
||||
revokeRefreshSession,
|
||||
revokeUserSession,
|
||||
sendPhoneLoginCode,
|
||||
handleAliyunSmsDeliveryReport,
|
||||
startWechatLogin,
|
||||
} from '../auth/authService.js';
|
||||
import {
|
||||
@@ -116,6 +117,8 @@ export function createAuthRoutes(context: AppContext) {
|
||||
const router = Router();
|
||||
const requireAuth = requireJwtAuth(context.config, context.userRepository);
|
||||
|
||||
router.use('/phone/delivery-report/aliyun', express.urlencoded({ extended: false }));
|
||||
|
||||
router.get(
|
||||
'/login-options',
|
||||
routeMeta({ operation: 'auth.login_options' }),
|
||||
@@ -178,6 +181,22 @@ export function createAuthRoutes(context: AppContext) {
|
||||
}),
|
||||
);
|
||||
|
||||
router.post(
|
||||
'/phone/delivery-report/aliyun',
|
||||
routeMeta({ operation: 'auth.phone.delivery_report.aliyun' }),
|
||||
asyncHandler(async (request, response) => {
|
||||
const payload =
|
||||
request.body && typeof request.body === 'object'
|
||||
? (request.body as Record<string, unknown>)
|
||||
: {};
|
||||
|
||||
sendApiResponse(
|
||||
response,
|
||||
await handleAliyunSmsDeliveryReport(context, payload),
|
||||
);
|
||||
}),
|
||||
);
|
||||
|
||||
router.post(
|
||||
'/phone/change',
|
||||
routeMeta({ operation: 'auth.phone.change' }),
|
||||
|
||||
Reference in New Issue
Block a user