File tree 4 files changed +23
-2
lines changed
4 files changed +23
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " permissionless " : patch
3
+ ---
4
+
5
+ Added return of userName for passkeys verification actions
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ export type VerifyAuthenticationReturnType = {
11
11
success : boolean
12
12
id : string
13
13
publicKey : Hex
14
+ userName : string
14
15
}
15
16
16
17
export const verifyAuthentication = async (
@@ -102,6 +103,7 @@ export const verifyAuthentication = async (
102
103
const success = Boolean ( serverResponse ?. success )
103
104
const id = serverResponse ?. id
104
105
const publicKey = serverResponse ?. publicKey
106
+ const userName = serverResponse ?. userName
105
107
106
108
if ( typeof id !== "string" ) {
107
109
throw new Error ( "Invalid passkey id returned from server" )
@@ -113,9 +115,14 @@ export const verifyAuthentication = async (
113
115
)
114
116
}
115
117
118
+ if ( typeof userName !== "string" ) {
119
+ throw new Error ( "Invalid user name returned from server" )
120
+ }
121
+
116
122
return {
117
123
success,
118
124
id,
119
- publicKey : publicKey as Hex
125
+ publicKey : publicKey as Hex ,
126
+ userName
120
127
}
121
128
}
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export type VerifyRegistrationReturnType = {
12
12
success : boolean
13
13
id : string
14
14
publicKey : Hex
15
+ userName : string
15
16
}
16
17
17
18
export const verifyRegistration = async (
@@ -105,6 +106,7 @@ export const verifyRegistration = async (
105
106
const success = Boolean ( serverResponse ?. success )
106
107
const id = serverResponse ?. id
107
108
const publicKey = serverResponse ?. publicKey
109
+ const userName = serverResponse ?. userName
108
110
109
111
if ( typeof id !== "string" ) {
110
112
throw new Error ( "Invalid passkey id returned from server" )
@@ -116,9 +118,14 @@ export const verifyRegistration = async (
116
118
)
117
119
}
118
120
121
+ if ( typeof userName !== "string" ) {
122
+ throw new Error ( "Invalid user name returned from server" )
123
+ }
124
+
119
125
return {
120
126
success,
121
127
id,
122
- publicKey : publicKey as Hex
128
+ publicKey : publicKey as Hex ,
129
+ userName
123
130
}
124
131
}
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ export type PasskeyServerRpcSchema = [
80
80
success : boolean
81
81
id : string
82
82
publicKey : Hex
83
+ userName : string
83
84
}
84
85
} ,
85
86
{
@@ -110,6 +111,7 @@ export type PasskeyServerRpcSchema = [
110
111
success : boolean
111
112
id : string
112
113
publicKey : Hex
114
+ userName : string
113
115
}
114
116
} ,
115
117
{
You can’t perform that action at this time.
0 commit comments