0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-13 21:30:30 -05:00

refactor(core): rename middleware

This commit is contained in:
Darcy Ye 2022-09-28 16:59:50 +08:00
parent 6f18d890ca
commit e1ec8804b2
No known key found for this signature in database
GPG key ID: B46F4C07EDEFC610
3 changed files with 8 additions and 8 deletions

View file

@ -12,7 +12,7 @@ import assertThat from '@/utils/assert-that';
type MiddlewareReturnType = ReturnType<typeof koaLog>;
export default function koaRegisterAction<StateT, ContextT, ResponseBodyT>(
export default function koaPasswordlessRegisterAction<StateT, ContextT, ResponseBodyT>(
provider: Provider,
via: Via
): MiddlewareReturnType {

View file

@ -18,7 +18,7 @@ import assertThat from '@/utils/assert-that';
type MiddlewareReturnType = ReturnType<typeof koaLog>;
export default function koaSignInAction<StateT, ContextT, ResponseBodyT>(
export default function koaPasswordlessSignInAction<StateT, ContextT, ResponseBodyT>(
provider: Provider,
via: Via
): MiddlewareReturnType {

View file

@ -22,8 +22,8 @@ import { AnonymousRouter } from '../types';
import { passwordlessVerificationTimeout } from './consts';
import { flowTypeGuard, viaGuard, PasscodePayload } from './types';
import { getRoutePrefix, getPasscodeType, getPasswordlessRelatedLogType } from './utils';
// Import koaSignInAction from './middleware/koa-sign-in-action';
// import koaRegisterAction from './middleware/koa-register-action';
// Import koaPasswordlessSignInAction from './middleware/koa-sign-in-action';
// import koaPasswordlessRegisterAction from './middleware/koa-register-action';
export const registerRoute = getRoutePrefix('register', 'passwordless');
export const signInRoute = getRoutePrefix('sign-in', 'passwordless');
@ -32,10 +32,10 @@ export default function passwordlessRoutes<T extends AnonymousRouter>(
router: T,
provider: Provider
) {
// Router.use(`${signInRoute}/sms`, koaSignInAction(provider, 'sms'));
// router.use(`${signInRoute}/email`, koaSignInAction(provider, 'email'));
// router.use(`${registerRoute}/sms`, koaRegisterAction(provider, 'sms'));
// router.use(`${registerRoute}/email`, koaRegisterAction(provider, 'email'));
// Router.use(`${signInRoute}/sms`, koaPasswordlessSignInAction(provider, 'sms'));
// router.use(`${signInRoute}/email`, koaPasswordlessSignInAction(provider, 'email'));
// router.use(`${registerRoute}/sms`, koaPasswordlessRegisterAction(provider, 'sms'));
// router.use(`${registerRoute}/email`, koaPasswordlessRegisterAction(provider, 'email'));
router.post(
`/passwordless/:via/send`,