create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
const path = require('path'); | |
const getWorkspaces = require('get-yarn-workspaces'); | |
const blacklist = require('metro-config/src/defaults/blacklist'); | |
const workspaces = getWorkspaces(__dirname); | |
module.exports = { | |
projectRoot: path.resolve(__dirname, 'packages/app'), |
Serial Keys: | |
FU512-2DG1H-M85QZ-U7Z5T-PY8ZD | |
CU3MA-2LG1N-48EGQ-9GNGZ-QG0UD | |
GV7N2-DQZ00-4897Y-27ZNX-NV0TD | |
YZ718-4REEQ-08DHQ-JNYQC-ZQRD0 | |
GZ3N0-6CX0L-H80UP-FPM59-NKAD4 | |
YY31H-6EYEJ-480VZ-VXXZC-QF2E0 | |
ZG51K-25FE1-H81ZP-95XGT-WV2C0 | |
VG30H-2AX11-H88FQ-CQXGZ-M6AY4 |
import React, { useState, useEffect, createContext, useContext, ReactNode } from 'react' | |
import Amplify, { Auth, Hub } from 'aws-amplify' | |
import { CognitoUser } from '@aws-amplify/auth' | |
import { CognitoUserSession } from 'amazon-cognito-identity-js' | |
import { HubCallback } from '@aws-amplify/core/lib/Hub' | |
import IUser from '../../types/IUser' | |
interface IAuthContext { | |
user: IUser | null | |
login(username: string, password: string): Promise<CognitoUser> |
import { useCallback, useState } from 'react'; | |
export interface ApiResult<R> { | |
data: R | null; | |
isBusy: boolean; | |
isError: boolean; | |
isSuccess: boolean; | |
} | |
function useCall<D, R>( |
Run amplify add function
and go thru the manual configuration and add access to other resources. Add API here.
Run amplify update api
if you have a project already setup and configure IAM as an additional auth mode.
Add the authorization as following to your type definition:
#!/bin/bash | |
# .git/hooks/post-checkout | |
# Utility to change AWS Amplify environments on branch checkout | |
# helper to get path to aws-exports.js | |
function get_aws_exports_path { | |
local AMPLIFY_PROJECT_CONFIG_PATH="amplify/.config/project-config.json" | |
local AMPLIFY_EXPORTS_PATH=$(jq -r '.javascript.config.SourceDir' $AMPLIFY_PROJECT_CONFIG_PATH) | |
if [[ "$AMPLIFY_EXPORTS_PATH" == */ ]] |
import { redirect, createCookie } from "remix"; | |
const sessionSecret = process.env.SESSION_SECRET; | |
const cognitoDomain = process.env.COGNITO_DOMAIN; | |
const clientId = process.env.CLIENT_ID; | |
if (!sessionSecret) { | |
throw new Error("SESSION_SECRET must be set"); | |
} | |
if (!cognitoDomain) { | |
throw new Error("COGNITO_DOMAIN must be set"); |
DISCLAIMER: Unfortunately this method is manual, but eventually needs to be done just the first time you create the Amplify Environment.
You need to have the aws-exports.js
file (generated by Amplify) to do this process.
We're gonna use a Environment variable (in my case BASE64_AWS_EXPORTS
) that will contain the aws-exports.js
file content encoded in base64
.
The script will then decode it and create the aws-exports.js
file.
The package.json
needs to be changed so that this script will be created before the build.