Skip to content

Commit

Permalink
Merge pull request #834 from vedranjukic/fix-basic-protocol-params
Browse files Browse the repository at this point in the history
fix(passport): Replaced @BodyParams with @arg
  • Loading branch information
Romakita committed May 27, 2020
2 parents eb482da + 9854b58 commit c2440db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/passportjs/src/protocols/BasicProtocol.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {BodyParams, Req} from "@tsed/common";
import {OnInstall, OnVerify, Protocol} from "@tsed/passport";
import {OnInstall, OnVerify, Protocol, Arg} from "@tsed/passport";
import {Strategy} from "passport";
import {BasicStrategy} from "passport-http";
import {UsersService} from "../services/users/UsersService";
Expand All @@ -14,7 +14,7 @@ export class BasicProtocol implements OnVerify, OnInstall {
constructor(private usersService: UsersService) {
}

async $onVerify(@Req() request: Req, @BodyParams("username") username: string, @BodyParams("password") password: string) {
async $onVerify(@Req() request: Req, @Arg(0) username: string, @Arg(1) password: string) {
checkEmail(username);

const user = await this.usersService.findOne({email: username});
Expand Down

0 comments on commit c2440db

Please sign in to comment.