Snippets Collections
const getToken = (request) => {
  const authorizationHeader = request.get("authorization");
  if (
    authorizationHeader &&
    authorizationHeader.toLowerCase().startsWith("bearer ")
  ) {
    return authorizationHeader.substring(7);
  }
  return null;
};
star

Wed Apr 20 2022 09:27:31 GMT+0000 (Coordinated Universal Time)

#javascript #jsonwebtoken

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension