mirror of
https://github.com/wassname/talk.git
synced 2026-06-27 20:54:05 +08:00
fix: rename wrapAuthz with wrapAuthn
This commit is contained in:
@@ -84,7 +84,7 @@ export async function handleSuccessfulLogin(
|
||||
}
|
||||
|
||||
/**
|
||||
* wrapAuthz will wrap a authenticators authenticate method with one that
|
||||
* wrapAuthn will wrap a authenticators authenticate method with one that
|
||||
* will return a valid login token for a valid login by a compatible strategy.
|
||||
*
|
||||
* @param authenticator the base authenticator instance
|
||||
@@ -92,7 +92,7 @@ export async function handleSuccessfulLogin(
|
||||
* @param name the name of the authenticator to use
|
||||
* @param options any options to be passed to the authenticate call
|
||||
*/
|
||||
export const wrapAuthz = (
|
||||
export const wrapAuthn = (
|
||||
authenticator: passport.Authenticator,
|
||||
signingConfig: JWTSigningConfig,
|
||||
name: string,
|
||||
|
||||
@@ -4,7 +4,7 @@ import passport from "passport";
|
||||
import { signupHandler } from "talk-server/app/handlers/auth/local";
|
||||
import { apiErrorHandler } from "talk-server/app/middleware/error";
|
||||
import { errorLogger } from "talk-server/app/middleware/logging";
|
||||
import { wrapAuthz } from "talk-server/app/middleware/passport";
|
||||
import { wrapAuthn } from "talk-server/app/middleware/passport";
|
||||
import tenantMiddleware from "talk-server/app/middleware/tenant";
|
||||
import managementGraphMiddleware from "talk-server/graph/management/middleware";
|
||||
import tenantGraphMiddleware from "talk-server/graph/tenant/middleware";
|
||||
@@ -61,18 +61,18 @@ function createNewAuthRouter(app: AppOptions, options: RouterOptions) {
|
||||
router.post(
|
||||
"/local",
|
||||
express.json(),
|
||||
wrapAuthz(options.passport, app.signingConfig, "local")
|
||||
wrapAuthn(options.passport, app.signingConfig, "local")
|
||||
);
|
||||
router.post(
|
||||
"/local/signup",
|
||||
express.json(),
|
||||
signupHandler({ db: app.mongo, signingConfig: app.signingConfig })
|
||||
);
|
||||
router.post("/sso", wrapAuthz(options.passport, app.signingConfig, "sso"));
|
||||
router.get("/oidc", wrapAuthz(options.passport, app.signingConfig, "oidc"));
|
||||
router.post("/sso", wrapAuthn(options.passport, app.signingConfig, "sso"));
|
||||
router.get("/oidc", wrapAuthn(options.passport, app.signingConfig, "oidc"));
|
||||
router.get(
|
||||
"/oidc/callback",
|
||||
wrapAuthz(options.passport, app.signingConfig, "oidc")
|
||||
wrapAuthn(options.passport, app.signingConfig, "oidc")
|
||||
);
|
||||
|
||||
return router;
|
||||
|
||||
Reference in New Issue
Block a user