UNPKG

@wristband/express-auth

Version:

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

28 lines (27 loc) 898 B
import { AuthService } from './auth-service'; /** * WristbandAuth is a utility class providing methods for seamless interaction with the Wristband authentication service. * @implements {WristbandAuth} */ export class WristbandAuthImpl { /** * Creates an instance of WristbandAuth. * * @param {AuthConfig} authConfig The configuration for Wristband authentication. */ constructor(authConfig) { this.authService = new 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); } }