File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,6 @@ public struct WebAuthnManager {
131
131
requireUserVerification: Bool = false
132
132
) throws -> VerifiedAuthentication {
133
133
let expectedRpID = config. relyingPartyID
134
- let expectedOrigin = config. relyingPartyOrigin
135
134
guard credential. type == " public-key " else { throw WebAuthnError . badRequestData }
136
135
137
136
let response = credential. response
@@ -140,9 +139,11 @@ public struct WebAuthnManager {
140
139
throw WebAuthnError . badRequestData
141
140
}
142
141
let clientData = try JSONDecoder ( ) . decode ( CollectedClientData . self, from: clientDataData)
143
- guard clientData. type == . assert else { throw WebAuthnError . badRequestData }
144
- guard expectedChallenge == clientData. challenge else { throw WebAuthnError . badRequestData }
145
- guard expectedOrigin == clientData. origin else { throw WebAuthnError . badRequestData }
142
+ try clientData. verify (
143
+ storedChallenge: expectedChallenge,
144
+ ceremonyType: . assert,
145
+ relyingPartyOrigin: config. relyingPartyOrigin
146
+ )
146
147
// TODO: - Verify token binding
147
148
148
149
guard let authenticatorDataBytes = response. authenticatorData. base64URLDecodedData else {
You can’t perform that action at this time.
0 commit comments