@authduo/authduo
Version:
Free User-sovereign Authentication for the World
26 lines • 837 B
JavaScript
import { Keys } from "../../auth/tokens/keys.js";
import { Proof } from "../../auth/tokens/proof.js";
export class Login {
proof;
keys;
constructor(proof, keys) {
this.proof = proof;
this.keys = keys;
}
static async verify(tokens, options) {
const proof = await Proof.verify(tokens.proofToken, options);
const keys = await Keys.verify(proof, tokens.keysToken, options);
return new this(proof, keys);
}
isExpired() { return this.proof.isExpired(); }
get name() { return this.keys.name; }
get thumbprint() { return this.proof.thumbprint; }
get expiresAt() { return this.proof.expiresAt; }
get tokens() {
return {
keysToken: this.keys.token,
proofToken: this.proof.token,
};
}
}
//# sourceMappingURL=login.js.map