Created
August 28, 2016 09:49
-
-
Save pellejacobs/498c997ebb8679ea90826177cf8a9bad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Session } from 'express' | |
let theSession: Session | |
theSession.user.login |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { User } from "./user"; | |
declare module 'express' { | |
interface Session { | |
user: User; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class User { | |
public login: string; | |
public hashedPassword: string; | |
constructor(login?: string, password?: string) { | |
this.login = login || ""; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment