Skip to content

Commit 0b9a86c

Browse files
committed
add type checks to prompt title and message
1 parent 2294054 commit 0b9a86c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ const canAuthenticate = () => {
2222
* @returns {Promise<boolean>}
2323
*/
2424
const requestBioAuth = (promptTitle, promptMessage) => {
25-
if (typeof promptTitle !== "string") {
26-
throw new Error("prompt title must be a string");
25+
if (typeof promptTitle !== "string" || !promptTitle) {
26+
throw new Error("prompt title must be a non empty string");
2727
}
2828

29-
if (!promptMessage) {
29+
if (typeof promptMessage !== "string" || !promptMessage) {
3030
throw new Error("prompt message must be a non empty string");
3131
}
3232

0 commit comments

Comments
 (0)