Skip to content

feat: require key-value adapter for storing generated passkey challange#20

Open
yaroslav8765 wants to merge 3 commits intomainfrom
feature/AdminForth/1139/question-in-current-implementa
Open

feat: require key-value adapter for storing generated passkey challange#20
yaroslav8765 wants to merge 3 commits intomainfrom
feature/AdminForth/1139/question-in-current-implementa

Conversation

@yaroslav8765
Copy link
Contributor

No description provided.

private async checkIfChallengeInBlackList(challenge: string): Promise<boolean> {
const res = await this.options.passkeys.keyValueAdapter.get(challenge);
if (!res) {
this.saveChallengeToStorage(challenge, this.options.passkeys?.challengeValidityPeriod || '2m');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yaroslav8765 "check" functions should not mutate state, this does not sound good,

100% better reading would be checkIfChellengeNotUsed() and separate method useChellenge()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants