diff --git a/package-lock.json b/package-lock.json index 98810efde..56b58d11b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,6 +49,7 @@ "socket.io-client": "^4.6.2", "tailwind-scrollbar": "^3.0.4", "tailwindcss": "^3.3.3", + "uuidv4": "^6.2.13", "yup": "^1.2.0" }, "devDependencies": { @@ -1456,6 +1457,11 @@ "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.7.tgz", "integrity": "sha512-cputDpIbFgLUaGQn6Vqg3/YsJwxUwHLO13v3i5ouxT4lat0khip9AEWxtERujXV9wxIB1EyF97BSJFt6vpdI8g==" }, + "node_modules/@types/uuid": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", + "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==" + }, "node_modules/@types/websocket": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.5.tgz", @@ -10741,9 +10747,9 @@ } }, "node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -11806,6 +11812,23 @@ "base64-arraybuffer": "^1.0.2" } }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/uuidv4": { + "version": "6.2.13", + "resolved": "https://registry.npmjs.org/uuidv4/-/uuidv4-6.2.13.tgz", + "integrity": "sha512-AXyzMjazYB3ovL3q051VLH06Ixj//Knx7QnUSi1T//Ie3io6CpsPu9nVMOx5MoLWh6xV0B9J0hIaxungxXUbPQ==", + "dependencies": { + "@types/uuid": "8.3.4", + "uuid": "8.3.2" + } + }, "node_modules/uvu": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.6.tgz", @@ -13374,6 +13397,11 @@ "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.7.tgz", "integrity": "sha512-cputDpIbFgLUaGQn6Vqg3/YsJwxUwHLO13v3i5ouxT4lat0khip9AEWxtERujXV9wxIB1EyF97BSJFt6vpdI8g==" }, + "@types/uuid": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", + "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==" + }, "@types/websocket": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.5.tgz", @@ -19565,9 +19593,9 @@ } }, "semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "requires": { "lru-cache": "^6.0.0" }, @@ -20345,6 +20373,20 @@ "base64-arraybuffer": "^1.0.2" } }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, + "uuidv4": { + "version": "6.2.13", + "resolved": "https://registry.npmjs.org/uuidv4/-/uuidv4-6.2.13.tgz", + "integrity": "sha512-AXyzMjazYB3ovL3q051VLH06Ixj//Knx7QnUSi1T//Ie3io6CpsPu9nVMOx5MoLWh6xV0B9J0hIaxungxXUbPQ==", + "requires": { + "@types/uuid": "8.3.4", + "uuid": "8.3.2" + } + }, "uvu": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.6.tgz", diff --git a/package.json b/package.json index e4af0800f..68e9bae08 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "socket.io-client": "^4.6.2", "tailwind-scrollbar": "^3.0.4", "tailwindcss": "^3.3.3", + "uuidv4": "^6.2.13", "yup": "^1.2.0" }, "devDependencies": { @@ -90,4 +91,4 @@ "eslint-plugin-tsdoc": "^0.2.17", "postcss": "^8.4.25" } -} \ No newline at end of file +} diff --git a/src/api/Auth.ts b/src/api/Auth.ts index f60eadb10..d6dd14c0d 100644 --- a/src/api/Auth.ts +++ b/src/api/Auth.ts @@ -6,12 +6,13 @@ import CryptoJS from "crypto-js" import { apiRoutes } from '../config/apiRoutes' import { envConfig } from '../config/envConfig' import { storageKeys } from '../config/CommonConstant' +import type { AddPassword } from '../components/Profile/interfaces' export interface UserSignUpData { email: string, } export interface AddPasswordDetails { - password:string + password?:string isPasskey:boolean firstName: string|null lastName: string|null @@ -135,6 +136,7 @@ export const checkUserExist = async(payload: string) => { } export const addPasswordDetails = async(payload: AddPasswordDetails, email:string) => { + // Api call to add password const details ={ url: `${apiRoutes.auth.addDetails}${email}`, payload, @@ -152,6 +154,29 @@ export const addPasswordDetails = async(payload: AddPasswordDetails, email:strin } +export const addPasskeyUserDetails = async(payload: AddPassword, email:string) => { + const token = await getFromLocalStorage(storageKeys.TOKEN) + const details ={ + url: `${apiRoutes.auth.passkeyUserDetails}${email}`, + payload, + config: { headers: { + 'Content-type': 'application/json', + 'Authorization': `Bearer ${token}`, + }, } + } + try{ + const response = await axiosPost(details) + return response + } + catch(error){ + const err = error as Error + return err?.message + } + + +} + + export const passwordEncryption = (password: string): string => { const CRYPTO_PRIVATE_KEY: string = `${envConfig.PUBLIC_CRYPTO_PRIVATE_KEY}` const encryptedPassword: string = CryptoJS.AES.encrypt(JSON.stringify(password), CRYPTO_PRIVATE_KEY).toString() diff --git a/src/app/FooterStacked.astro b/src/app/FooterStacked.astro index 6f08ba693..3ecd3a26c 100644 --- a/src/app/FooterStacked.astro +++ b/src/app/FooterStacked.astro @@ -7,7 +7,7 @@ import CopyrightNotice from '../components/CopyrightNotice.astro'; > -