UNPKG

@wristband/express-auth

Version:

SDK for integrating your ExpressJS application with Wristband. Handles user authentication and token management.

32 lines (31 loc) 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WristbandAuthImpl = void 0; const auth_service_1 = require("./auth-service"); /** * WristbandAuth is a utility class providing methods for seamless interaction with the Wristband authentication service. * @implements {WristbandAuth} */ class WristbandAuthImpl { /** * Creates an instance of WristbandAuth. * * @param {AuthConfig} authConfig The configuration for Wristband authentication. */ constructor(authConfig) { this.authService = new auth_service_1.AuthService(authConfig); } login(req, res, config) { return this.authService.login(req, res, config); } callback(req, res) { return this.authService.callback(req, res); } logout(req, res, config) { return this.authService.logout(req, res, config); } refreshTokenIfExpired(refreshToken, expiresAt) { return this.authService.refreshTokenIfExpired(refreshToken, expiresAt); } } exports.WristbandAuthImpl = WristbandAuthImpl;