File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,17 +33,17 @@ public function withPasskey(Passkey $passkey): static
3333 */
3434 public function toResponse ($ request )
3535 {
36- if ($ request ->wantsJson ()) {
37- $ data = ['status ' => 'passkey-registered ' ];
36+ if (! $ request ->wantsJson ()) {
37+ return back ()->with ('status ' , 'passkey-registered ' );
38+ }
3839
39- if ($ this ->passkey instanceof \Laravel \Passkeys \Passkey) {
40- $ data ['id ' ] = (string ) $ this ->passkey ->id ;
41- $ data ['name ' ] = $ this ->passkey ->name ;
42- }
40+ $ data = ['status ' => 'passkey-registered ' ];
4341
44- return new JsonResponse ($ data , 200 );
42+ if ($ this ->passkey instanceof \Laravel \Passkeys \Passkey) {
43+ $ data ['id ' ] = (string ) $ this ->passkey ->id ;
44+ $ data ['name ' ] = $ this ->passkey ->name ;
4545 }
4646
47- return back ()-> with ( ' status ' , ' passkey-registered ' );
47+ return new JsonResponse ( $ data , 200 );
4848 }
4949}
You can’t perform that action at this time.
0 commit comments