Skip to content

Commit

Permalink
Revised AbstractStrategy for authenticate method to match PassportStr…
Browse files Browse the repository at this point in the history
…ategy expectation
  • Loading branch information
algoritmodourado committed May 29, 2023
1 parent 2d10c9a commit a4699b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/multiSamlStrategy.ts
Expand Up @@ -39,7 +39,7 @@ export class MultiSamlStrategy extends AbstractStrategy {
this._options = samlConfig;
}

authenticate(req: RequestWithUser, options: AuthenticateOptions): void {
authenticate(req: Request, options: AuthenticateOptions): void {
this._options.getSamlOptions(req, (err, samlOptions) => {
if (err) {
return this.error(err);
Expand Down
5 changes: 3 additions & 2 deletions src/strategy.ts
Expand Up @@ -10,6 +10,7 @@ import {
VerifyWithoutRequest,
VerifyWithRequest,
} from "./types";
import { Request } from "express";

export abstract class AbstractStrategy extends PassportStrategy {
static readonly newSamlProviderOnConstruct: boolean;
Expand Down Expand Up @@ -56,7 +57,7 @@ export abstract class AbstractStrategy extends PassportStrategy {
this._passReqToCallback = !!options.passReqToCallback;
}

authenticate(req: RequestWithUser, options: AuthenticateOptions): void {
authenticate(req: Request, options: AuthenticateOptions): void {
if (this._saml == null) {
throw new Error("Can't get authenticate without a SAML provider defined.");
}
Expand Down Expand Up @@ -256,7 +257,7 @@ export abstract class AbstractStrategy extends PassportStrategy {
redirect(url: string, status?: number): void {
super.redirect(url, status);
}
success(user: any, info?: any): void {
success(user: unknown, info?: unknown): void {
super.success(user, info);
}
}
Expand Down

0 comments on commit a4699b5

Please sign in to comment.