Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

Commit

Permalink
fix: challenge and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
kymppi committed Jan 18, 2022
1 parent e636cac commit fa5a92b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rittaschool/shared",
"version": "0.0.26",
"version": "0.0.27",
"main": "./lib/index.cjs.js",
"module": "./lib/index.esm.js",
"types": "./lib/index.d.ts",
Expand Down
20 changes: 13 additions & 7 deletions src/classes/Challenge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ import { randomUUID } from "crypto";
export interface Challenge {
id: string;
type: IChallengeType;
data?:
| IPasswordChallengeData
| IOtpChallengeData
| IFido2ChallengeData
| null;
data?: ChallengeData | null;
userId: string;
}

export interface ChallengeData {
passwordData?: IPasswordChallengeData | null;
otpData?: IOtpChallengeData | null;
fido2Data?: IFido2ChallengeData | null;
}

export const generateChallenge = (
type: IChallengeType,
userId: string
Expand All @@ -25,12 +27,16 @@ export const generateChallenge = (
switch (type) {
case IChallengeType.PASSWORD_NEEDED:
challenge.data = {
password: "",
passwordData: {
password: "",
},
};
break;
case IChallengeType.OTP_NEEDED:
challenge.data = {
otp: "",
otpData: {
otp: "",
},
};
break;
case IChallengeType.FIDO2_NEEDED:
Expand Down

0 comments on commit fa5a92b

Please sign in to comment.