-
-
Notifications
You must be signed in to change notification settings - Fork 466
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(experience): add hidden identifier input for browser passwor…
…d manager
- Loading branch information
Showing
4 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
packages/experience/src/containers/SetPassword/HiddenIdentifierInput.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { useContext } from 'react'; | ||
|
||
import UserInteractionContext from '@/Providers/UserInteractionContextProvider/UserInteractionContext'; | ||
|
||
/** | ||
* This component renders a hidden input field that stores the user's identifier. | ||
* Its primary purpose is to assist password managers in associating the correct | ||
* identifier with the password being set or changed. | ||
* | ||
* By including this hidden field, we enable password managers to correctly save | ||
* or update the user's credentials, enhancing the user experience and security. | ||
*/ | ||
const HiddenIdentifierInput = () => { | ||
const { identifierInputValue } = useContext(UserInteractionContext); | ||
|
||
if (!identifierInputValue) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<input readOnly hidden type={identifierInputValue.type} value={identifierInputValue.value} /> | ||
); | ||
}; | ||
|
||
export default HiddenIdentifierInput; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters