UNPKG

landstrasse

Version:

Strongly typed WAMP Client for browsers

36 lines 1.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const AbstractAuthProvider_1 = require("./AbstractAuthProvider"); /** * Ticket authentication provider. * * This can be used to login with username and password or any other sort of static token. */ class TicketAuthProvider extends AbstractAuthProvider_1.default { /** * Creates a new instance of the ticket provider. * * @param authId - The username to send to the server. * @param ticketFunction - A callback used to retrieve the token/password. * @param authMethod - Name of the authmethod (default: 'ticket'). */ constructor(authId, ticketFunction, authMethod = 'ticket') { super(authId, authMethod); Object.defineProperty(this, "_ticketFunction", { enumerable: true, configurable: true, writable: true, value: void 0 }); this._ticketFunction = ticketFunction; } get isTransportLevel() { return false; } /** @inheritDoc */ computeChallenge(authExtra) { return this._ticketFunction(authExtra); } } exports.default = TicketAuthProvider; //# sourceMappingURL=Ticket.js.map