Created
October 24, 2022 12:36
-
-
Save akkonrad/d43fed4b083776525aa8846070fd70ac to your computer and use it in GitHub Desktop.
auth/auth.config.ts
This file contains 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 { Injectable } from '@nestjs/common'; | |
@Injectable() | |
export class AuthConfig { | |
public userPoolId: string; | |
public clientId: string; | |
public region: string; | |
public authority; | |
constructor() { | |
const { COGNITO_USER_POOL_ID, COGNITO_CLIENT_ID, COGNITO_REGION } = | |
process.env; | |
this.userPoolId = COGNITO_USER_POOL_ID; | |
this.clientId = COGNITO_CLIENT_ID; | |
this.region = COGNITO_REGION; | |
this.authority = `https://cognito-idp.${COGNITO_REGION}.amazonaws.com/${COGNITO_USER_POOL_ID}`; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment