@@ -169,9 +169,8 @@ protected function bindWebAuthnPackage(): void
169169 AttestationObjectLoader::class,
170170 fn ($ app ) => tap (new AttestationObjectLoader (
171171 $ app [AttestationStatementSupportManager::class]
172- ), function ($ loader ) use ($ app ) {
173- $ loader ->setLogger ($ app ['webauthn.log ' ]);
174- })
172+ ), fn (AttestationObjectLoader $ loader ) => $ loader ->setLogger ($ app ['webauthn.log ' ])
173+ )
175174 );
176175
177176 $ this ->app ->bind (
@@ -186,50 +185,43 @@ protected function bindWebAuthnPackage(): void
186185 null ,
187186 null ,
188187 $ app [ExtensionOutputCheckerHandler::class]
189- ), function ($ responseValidator ) use ($ app ) {
190- $ responseValidator ->setLogger ($ app ['webauthn.log ' ]);
191- })
188+ ), fn (AuthenticatorAttestationResponseValidator $ responseValidator ) => $ responseValidator ->setLogger ($ app ['webauthn.log ' ])
189+ )
192190 );
193191 $ this ->app ->bind (
194192 AuthenticatorAssertionResponseValidator::class,
195- fn ($ app ) => tap (new AuthenticatorAssertionResponseValidator (
193+ fn ($ app ) => tap (( new AuthenticatorAssertionResponseValidator (
196194 null ,
197195 null ,
198196 $ app [ExtensionOutputCheckerHandler::class],
199197 $ app [CoseAlgorithmManager::class]
200- ), function ($ responseValidator ) use ($ app ) {
201- $ responseValidator ->setCounterChecker ($ app [CounterChecker::class])
202- ->setLogger ($ app ['webauthn.log ' ]);
203- })
198+ ))
199+ ->setCounterChecker ($ app [CounterChecker::class]), fn (AuthenticatorAssertionResponseValidator $ responseValidator ) => $ responseValidator ->setLogger ($ app ['webauthn.log ' ])
200+ )
204201 );
205202 $ this ->app ->bind (
206203 AuthenticatorSelectionCriteria::class,
207- fn ($ app ) => tap (new AuthenticatorSelectionCriteria (), function ($ authenticatorSelectionCriteria ) use ($ app ) {
208- $ authenticatorSelectionCriteria
209- ->setAuthenticatorAttachment ($ app ['config ' ]->get ('webauthn.attachment_mode ' , 'null ' ))
210- ->setUserVerification ($ app ['config ' ]->get ('webauthn.user_verification ' , 'preferred ' ));
211-
212- if (($ userless = $ app ['config ' ]->get ('webauthn.userless ' )) !== null ) {
213- $ authenticatorSelectionCriteria ->setResidentKey ($ userless );
214- }
215- })
204+ fn ($ app ) => new AuthenticatorSelectionCriteria (
205+ $ app ['config ' ]->get ('webauthn.attachment_mode ' , 'null ' ),
206+ $ app ['config ' ]->get ('webauthn.user_verification ' , 'preferred ' ),
207+ $ app ['config ' ]->get ('webauthn.userless ' )
208+ )
216209 );
217210
218211 $ this ->app ->bind (
219212 PublicKeyCredentialRpEntity::class,
220213 fn ($ app ) => new PublicKeyCredentialRpEntity (
221214 $ app ['config ' ]->get ('app.name ' , 'Laravel ' ),
222- $ app ->make ('request ' )->getHost (),
215+ $ app ->make ('request ' )->host (),
223216 $ app ['config ' ]->get ('webauthn.icon ' )
224217 )
225218 );
226219 $ this ->app ->bind (
227220 PublicKeyCredentialLoader::class,
228221 fn ($ app ) => tap (new PublicKeyCredentialLoader (
229222 $ app [AttestationObjectLoader::class]
230- ), function ($ loader ) use ($ app ) {
231- $ loader ->setLogger ($ app ['webauthn.log ' ]);
232- })
223+ ), fn (PublicKeyCredentialLoader $ loader ) => $ loader ->setLogger ($ app ['webauthn.log ' ])
224+ )
233225 );
234226
235227 $ this ->app ->bind (
@@ -348,14 +340,13 @@ protected function bindPsrInterfaces(): void
348340
349341 private function passwordLessWebauthn (): void
350342 {
351- $ this ->app ['auth ' ]->provider ('webauthn ' , function ($ app , array $ config ) {
352- return new EloquentWebAuthnProvider (
353- $ app ['config ' ],
354- $ app [CredentialAssertionValidator::class],
355- $ app [Hasher::class],
356- $ config ['model ' ]
357- );
358- });
343+ $ this ->app ['auth ' ]->provider ('webauthn ' , fn ($ app , array $ config ) => new EloquentWebAuthnProvider (
344+ $ app ['config ' ],
345+ $ app [CredentialAssertionValidator::class],
346+ $ app [Hasher::class],
347+ $ config ['model ' ]
348+ )
349+ );
359350 }
360351
361352 /**
0 commit comments