Skip to Main Content
Advanced TypeScript Programming Projects
book

Advanced TypeScript Programming Projects

by Peter O'Hanlon
July 2019
Intermediate to advanced content levelIntermediate to advanced
416 pages
10h 6m
English
Packt Publishing
Content preview from Advanced TypeScript Programming Projects

Authorizing and authenticating users using Auth0

Our authorization is going to consist of two parts—a service to perform the authorization, and a model to make working with the authorization simple. We will start off by creating our Authorization model, which contains the details we will receive back from a successful login. Note that the constructor brings in the Socket instance:

export class Authorization {  constructor(private socket: Socket);  public IdToken: string;  public AccessToken: string;  public Expired: number;  public Email: string;}

We can use this to create a series of useful helper methods. The first one we are going to create is a method to set the public properties if the user logs in. We are identifying a successful login as ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learn TypeScript 3 by Building Web Applications

Learn TypeScript 3 by Building Web Applications

Sebastien Dubois, Alexis Georges

Publisher Resources

ISBN: 9781789133042Supplemental Content