rewardwee_auth_access
Version:
auth verify access for all microservices
46 lines (45 loc) • 1.04 kB
TypeScript
import { Response } from 'express';
import { RESPONSE_TYPE } from './customTypes';
/**
* A function that returns http response as a stream.
*
* @param res - response object.
*
* @param data - data to be sent as response.
*
* @returns - a void promise.
*
* @remarks - this function is used to send response to the client.
*
* @beta
*
*
*
*/
export declare const response: (res: Response, data: RESPONSE_TYPE) => void;
/**
* A function that extracts the content of a jwt token.
*
* @param token - token to be extracted.
* @returns - a promise that resolves to a RESPONSE_TYPE object.
*
*
* @remarks
*
* This function uses the jsonwebtoken library to extract the content of the token.
*
* @beta
*
* @example
*
*
* extractTokenContent(token)
* .then((done: RESPONSE_TYPE)=>{
* console.log(done);
* })
* .catch((err: any)=>{
* console.log(err);
* })
*
*/
export declare const extractTokenContent: (token: string, secret: string) => Promise<RESPONSE_TYPE>;