fix: rename wrapAuthz with wrapAuthn

This commit is contained in:
Wyatt Johnson
2018-08-01 15:56:04 -06:00
parent c221f827b4
commit 201e5fbcb1
2 changed files with 7 additions and 7 deletions
@@ -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,
+5 -5
View File
@@ -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;