Skip to content

Instantly share code, notes, and snippets.

View abanobmikaeel's full-sized avatar
👋

Abanob Mikaeel abanobmikaeel

👋
  • New Jersey, USA
View GitHub Profile
@abanobmikaeel
abanobmikaeel / migrate.js
Last active October 29, 2023 16:26
Migration Lambda from Basic Auth to Cognito
const { Client } = require('pg');
const AmazonCognitoIdentity = require('amazon-cognito-identity-js');
exports.handler = async (event) => {
const { username, password } = JSON.parse(event.body);
// Validate credentials against PostgreSQL database
const postgresClient = new Client({
host: process.env.RDS_HOST,
user: process.env.RDS_USER,