Skip to content

Instantly share code, notes, and snippets.

@akkonrad
Created October 24, 2022 12:36
Show Gist options
  • Save akkonrad/d43fed4b083776525aa8846070fd70ac to your computer and use it in GitHub Desktop.
Save akkonrad/d43fed4b083776525aa8846070fd70ac to your computer and use it in GitHub Desktop.
auth/auth.config.ts
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