mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
54854bacb1
Issuer is customizable in configuration so that a company can set its own name or website. If not provided, default value is 'authelia.com'. The username is used as label.
22 lines
642 B
TypeScript
22 lines
642 B
TypeScript
import Sinon = require("sinon");
|
|
import BluebirdPromise = require("bluebird");
|
|
import { ITotpHandler } from "../../src/lib/authentication/totp/ITotpHandler";
|
|
import { TOTPSecret } from "../../types/TOTPSecret";
|
|
|
|
export class TotpHandlerStub implements ITotpHandler {
|
|
generateStub: Sinon.SinonStub;
|
|
validateStub: Sinon.SinonStub;
|
|
|
|
constructor() {
|
|
this.generateStub = Sinon.stub();
|
|
this.validateStub = Sinon.stub();
|
|
}
|
|
|
|
generate(label: string, issuer: string): TOTPSecret {
|
|
return this.generateStub(label, issuer);
|
|
}
|
|
|
|
validate(token: string, secret: string): boolean {
|
|
return this.validateStub(token, secret);
|
|
}
|
|
} |