File tree Expand file tree Collapse file tree 3 files changed +52
-6
lines changed Expand file tree Collapse file tree 3 files changed +52
-6
lines changed Original file line number Diff line number Diff line change 1
1
# Upgrade Guide
2
2
3
+ ## General Notes
4
+
5
+ After updating Passport, you should always re-publish and re-compile the Vue "quickstart" assets if you're using them:
6
+
7
+ php artisan vendor:publish --tag=passport-views --force
8
+
3
9
## Upgrading To 9.0 From 8.0
4
10
5
11
### Support For Multiple Guards
Original file line number Diff line number Diff line change 224
224
</div >
225
225
</div >
226
226
</div >
227
+
228
+ <!-- Client Secret Modal -->
229
+ <div class =" modal fade" id =" modal-client-secret" tabindex =" -1" role =" dialog" >
230
+ <div class =" modal-dialog" >
231
+ <div class =" modal-content" >
232
+ <div class =" modal-header" >
233
+ <h4 class =" modal-title" >
234
+ Client Secret
235
+ </h4 >
236
+
237
+ <button type =" button" class =" close" data-dismiss =" modal" aria-hidden =" true" >× ; </button >
238
+ </div >
239
+
240
+ <div class =" modal-body" >
241
+ <p >
242
+ Here is your new client secret. This is the only time it will be shown so don't lose it!
243
+ You may now use this secret to make API requests.
244
+ </p >
245
+
246
+ <input type =" text" class =" form-control" v-model =" clientSecret" >
247
+ </div >
248
+
249
+ <!-- Modal Actions -->
250
+ <div class =" modal-footer" >
251
+ <button type =" button" class =" btn btn-secondary" data-dismiss =" modal" >Close</button >
252
+ </div >
253
+ </div >
254
+ </div >
255
+ </div >
227
256
</div >
228
257
</template >
229
258
236
265
return {
237
266
clients: [],
238
267
268
+ clientSecret: null ,
269
+
239
270
createForm: {
240
271
errors: [],
241
272
name: ' ' ,
341
372
342
373
axios[method](uri, form)
343
374
.then (response => {
344
- if (method === ' post' ) {
345
- this .clients .push (response .data );
346
- } else {
347
- this .getClients ();
348
- }
375
+ this .getClients ();
349
376
350
377
form .name = ' ' ;
351
378
form .redirect = ' ' ;
352
379
form .errors = [];
353
380
354
381
$ (modal).modal (' hide' );
382
+
383
+ if (response .data .plainSecret ) {
384
+ this .showClientSecret (response .data .plainSecret );
385
+ }
355
386
})
356
387
.catch (error => {
357
388
if (typeof error .response .data === ' object' ) {
362
393
});
363
394
},
364
395
396
+ /**
397
+ * Show the given client secret to the user.
398
+ */
399
+ showClientSecret (clientSecret ) {
400
+ this .clientSecret = clientSecret;
401
+
402
+ $ (' #modal-client-secret' ).modal (' show' );
403
+ },
404
+
365
405
/**
366
406
* Destroy the given client.
367
407
*/
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ public function store(Request $request)
89
89
);
90
90
91
91
if (Passport::$ hashesClientSecrets ) {
92
- return ['secret ' => $ client ->plainSecret ] + $ client ->toArray ();
92
+ return ['plainSecret ' => $ client ->plainSecret ] + $ client ->toArray ();
93
93
}
94
94
95
95
return $ client ->makeVisible ('secret ' );
You can’t perform that action at this time.
0 commit comments