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 11# Upgrade Guide
22
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+
39## Upgrading To 9.0 From 8.0
410
511### Support For Multiple Guards
Original file line number Diff line number Diff line change 224224 </div >
225225 </div >
226226 </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 >
227256 </div >
228257</template >
229258
236265 return {
237266 clients: [],
238267
268+ clientSecret: null ,
269+
239270 createForm: {
240271 errors: [],
241272 name: ' ' ,
341372
342373 axios[method](uri, form)
343374 .then (response => {
344- if (method === ' post' ) {
345- this .clients .push (response .data );
346- } else {
347- this .getClients ();
348- }
375+ this .getClients ();
349376
350377 form .name = ' ' ;
351378 form .redirect = ' ' ;
352379 form .errors = [];
353380
354381 $ (modal).modal (' hide' );
382+
383+ if (response .data .plainSecret ) {
384+ this .showClientSecret (response .data .plainSecret );
385+ }
355386 })
356387 .catch (error => {
357388 if (typeof error .response .data === ' object' ) {
362393 });
363394 },
364395
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+
365405 /**
366406 * Destroy the given client.
367407 */
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ public function store(Request $request)
8989 );
9090
9191 if (Passport::$ hashesClientSecrets ) {
92- return ['secret ' => $ client ->plainSecret ] + $ client ->toArray ();
92+ return ['plainSecret ' => $ client ->plainSecret ] + $ client ->toArray ();
9393 }
9494
9595 return $ client ->makeVisible ('secret ' );
You can’t perform that action at this time.
0 commit comments