Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Apr 9th, 2020 117 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public async use (@Req() req: Req, @EndpointInfo() endpoint: EndpointInfo) {
  2.         // const options = endpoint.get(FirebaseAuth) || {};
  3.         const token: string = this.getToken(req);
  4.         try {
  5.             await this.app.auth().verifyIdToken(token)
  6.         } catch (e) {
  7.             $log.error(e);
  8.             throw(new Unauthorized('Decoding token failed'));
  9.         }
  10.  
  11.     }
  12.  
  13.     private getToken(req: Req): string {
  14.         if (req.headers.authorization  && req.headers.authorization.split(' ')[0] === 'Bearer') {
  15.             return req.headers.authorization.split(' ')[1];
  16.         }
  17.         $log.error('Token not found');
  18.         throw(new Unauthorized('Token not found'));
  19.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top