Skip to content

Instantly share code, notes, and snippets.

View sebastiangug's full-sized avatar
🛰️

Sebastian Gug sebastiangug

🛰️
View GitHub Profile
// Help file for those experiencing the unmovable 401 for the passport-jwt auth implementation with nest.
// make sure to keep all configuration exactly like in the documentation -- this is in addition to that, not to replace that.
// unless directly specified
// STRATEGY
import { Injectable } from '@nestjs/common';
import { Strategy, ExtractJwt } from 'passport-jwt';
@sebastiangug
sebastiangug / country-phone-prefixes.js
Last active June 25, 2020 07:56
A Javascript array of objects with key value pairs {country: string, value: number} of country code prefixes.
export const Prefixes = [
{ country: "United Kingdom", value: 44 },
{ country: "United States", value: 1 },
{ country: "Algeria", value: 213 },
{ country: "Andorra", value: 376 },
{ country: "Angola", value: 244 },
{ country: "Anguilla", value: 1264 },
{ country: "Antigua & Barbuda", value: 1268 },
{ country: "Argentina", value: 54 },
{ country: "Armenia", value: 374 },
@sebastiangug
sebastiangug / country-phone-prefix-codes-enum.ts
Created June 25, 2020 07:17
A typescript enum of all country phone prefix codes. Useful for input validation & forms on the client.
export enum Prefixes {
UK = 44,
USA = 1,
Algeria = 213,
Andorra = 376,
Angola = 244,
Anguilla = 1264,
AntiguaBarbuda = 1268,
Argentina = 54,
Armenia = 374,