Created
October 15, 2018 14:17
-
-
Save workfel/03441543aec48950e5fc44e28b6b383e to your computer and use it in GitHub Desktop.
nest auth auth.module
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 AuthModule implements NestModule { | |
public configure(consumer: MiddlewaresConsumer) { | |
consumer | |
// Saving the socketId on session | |
.apply(SessionAuthMiddleware).forRoutes('/auth/google') | |
// Authenticate to google signin api for /auth/google route | |
.apply(StrategyMiddleware).with({ provider: 'google' }).forRoutes('/auth/google') | |
// After signin google call this endpoint | |
.apply(StrategyCallbackMiddleware).with({ provider: 'google' }).forRoutes('auth/google/callback'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment