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

Commit

Permalink
fix: remove default submission for protection session duration
Browse files Browse the repository at this point in the history
  • Loading branch information
antsgar committed Feb 18, 2021
1 parent a9f465e commit ad0fa43
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions src/screens/Authenticate/Authenticate.tsx
Expand Up @@ -149,36 +149,6 @@ export const Authenticate = ({
}
}, [navigation, challenge, application, pending]);

const [
submittedProtectionSessionDuration,
setSubmittedProtectionSessionDuration,
] = useState(-1);
useEffect(() => {
/**
* Eagerly submit protectedSessionDuration prompts, because there should
* always be a default value for them.
*/
const prompt = challenge.prompts.find(
p => p.validation === ChallengeValidation.ProtectionSessionDuration
);
if (!prompt) {
return;
}

const value = challengeValues[prompt.id].value as number;
if (submittedProtectionSessionDuration !== value) {
setSubmittedProtectionSessionDuration(value);
application?.submitValuesForChallenge(challenge, [
new ChallengeValue(prompt, value),
]);
}
}, [
application,
challenge,
challengeValues,
submittedProtectionSessionDuration,
]);

const validateChallengeValue = useCallback(
async (challengeValue: ChallengeValue) => {
if (singleValidation) {
Expand Down

0 comments on commit ad0fa43

Please sign in to comment.