mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
16 lines
404 B
TypeScript
16 lines
404 B
TypeScript
|
|
||
|
import * as speakeasy from "speakeasy";
|
||
|
import { Speakeasy } from "../types/Dependencies";
|
||
|
import BluebirdPromise = require("bluebird");
|
||
|
|
||
|
export default class TOTPGenerator {
|
||
|
private speakeasy: Speakeasy;
|
||
|
|
||
|
constructor(speakeasy: Speakeasy) {
|
||
|
this.speakeasy = speakeasy;
|
||
|
}
|
||
|
|
||
|
generate(options: speakeasy.GenerateOptions): speakeasy.Key {
|
||
|
return this.speakeasy.generateSecret(options);
|
||
|
}
|
||
|
}
|