Skip to content

Commit

Permalink
Merge pull request #19 from indigoai-us/feature/migrate-to-clerk-auth
Browse files Browse the repository at this point in the history
Feature/migrate to clerk auth
  • Loading branch information
johnsonfamily1234 authored Jan 13, 2024
2 parents b6e8eec + 24e09d2 commit 474bc32
Show file tree
Hide file tree
Showing 41 changed files with 12,044 additions and 18,228 deletions.
17 changes: 0 additions & 17 deletions amplify/.config/project-config.json

This file was deleted.

8 changes: 0 additions & 8 deletions amplify/README.md

This file was deleted.

20 changes: 0 additions & 20 deletions amplify/backend/auth/indigoelectron2d40aae43/parameters.json

This file was deleted.

108 changes: 0 additions & 108 deletions amplify/backend/backend-config.json

This file was deleted.

13 changes: 0 additions & 13 deletions amplify/backend/storage/visionimages/cli-inputs.json

This file was deleted.

10 changes: 0 additions & 10 deletions amplify/backend/tags.json

This file was deleted.

8 changes: 0 additions & 8 deletions amplify/backend/types/amplify-dependent-resources-ref.d.ts

This file was deleted.

63 changes: 0 additions & 63 deletions amplify/cli.json

This file was deleted.

7 changes: 0 additions & 7 deletions amplify/hooks/README.md

This file was deleted.

35 changes: 0 additions & 35 deletions amplify/team-provider-info.json

This file was deleted.

1 change: 1 addition & 0 deletions assets/animations/circle2-loader.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"nm":"Comp 1","ddd":0,"h":736,"w":414,"meta":{"g":"@lottiefiles/toolkit-js 0.26.1"},"layers":[{"ty":4,"nm":"Loading3","sr":1,"st":0,"op":91,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[100,100,100],"t":26},{"s":[1000,1000,100],"t":71}],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[207,368,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":26},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[100],"t":46},{"s":[0],"t":71}],"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Loading1","ix":1,"cix":2,"np":2,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"s":{"a":0,"k":[14,14],"ix":2}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"c":{"a":0,"k":[0.298,0.0235,0.8431],"ix":3}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":1},{"ty":4,"nm":"Loading2","sr":1,"st":0,"op":90,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[100,100,100],"t":12},{"s":[1000,1000,100],"t":57}],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[207,368,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":12},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[100],"t":32},{"s":[0],"t":57}],"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Loading1","ix":1,"cix":2,"np":2,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"s":{"a":0,"k":[14,14],"ix":2}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"c":{"a":0,"k":[0.298,0.0235,0.8431],"ix":3}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":2},{"ty":4,"nm":"Loading1","sr":1,"st":0,"op":90,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[100,100,100],"t":0},{"s":[1000,1000,100],"t":45}],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[207,368,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[100],"t":20},{"s":[0],"t":45}],"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"mn":"ADBE Vector Group","nm":"Loading1","ix":1,"cix":2,"np":2,"it":[{"ty":"el","bm":0,"hd":false,"mn":"ADBE Vector Shape - Ellipse","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,0],"ix":3},"s":{"a":0,"k":[14,14],"ix":2}},{"ty":"st","bm":0,"hd":false,"mn":"ADBE Vector Graphic - Stroke","nm":"Stroke 1","lc":1,"lj":1,"ml":4,"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"c":{"a":0,"k":[0.298,0.0235,0.8431],"ix":3}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":3}],"v":"4.12.0","fr":30,"op":90,"ip":0,"assets":[]}
6 changes: 6 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"AWS_ID": "your AWS ID",
"AWS_SECRET": "your AWS Secret",
"BUCKET_NAME": "a S3 bucket name",
"cdnDomain": "optionally an domain name to replace the s3 bucket domain (ie: example.com) - leave out http & slashes"
}
27 changes: 10 additions & 17 deletions lib/slices/createCommandSlice.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { API } from "aws-amplify";
import { Auth } from "aws-amplify";
import { StateCreator } from "zustand";
import useFetch from "../../src/utils/useFetch";

export interface Command {
data: any;
Expand All @@ -11,23 +10,17 @@ export interface Command {

export interface CommandSlice {
commands: Command[];
fetchCommands: () => void;
fetchCommands: (getToken: any) => void;
clearCommands: () => void;
}

export const createCommandSlice: StateCreator<CommandSlice> = (set) => ({
commands: [],
fetchCommands: async () => {
const user = await Auth.currentAuthenticatedUser();
const commandsData = await API.get('be1', '/commands', {
headers: {
custom_header: `Bearer ${user.signInUserSession.idToken.jwtToken}`, // get jwtToken
},
queryStringParameters: {sub: user.attributes.sub}
}).catch((error: any) => console.log(error.response));
const commands = commandsData?.data;
console.log('zustand createCommandsSlice commands: ', commands);
set({ commands })
},
clearCommands: () => set({ commands: [] }),
commands: [],
fetchCommands: async (getToken: any) => {
const gotCommands = await useFetch('/commands', 'GET', null, getToken);
console.log('zustand gotCommands commands: ', gotCommands);
const commands = gotCommands?.data;
set({ commands })
},
clearCommands: () => set({ commands: [] })
})
Loading

0 comments on commit 474bc32

Please sign in to comment.