File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ SourceGithub.rest_api = function(endpoint) {
1919
2020jQuery ( document ) . ready ( function ( $ ) {
2121 $ ( '#hub_app_client_id, #hub_app_secret' ) . change ( set_visibility ) ;
22+ $ ( '#btn_auth_revoke' ) . click ( revoke_token ) ;
2223 $ ( '#webhook_create > button' ) . click ( webhook_create ) ;
2324
2425 // The PHP code initially hides all token authorization elements using the.
@@ -59,6 +60,19 @@ jQuery(document).ready(function($) {
5960 }
6061 }
6162
63+ function revoke_token ( ) {
64+ var repo_id = $ ( '#repo_id' ) . val ( ) ;
65+
66+ $ . ajax ( {
67+ type : 'DELETE' ,
68+ url : SourceGithub . rest_api ( repo_id + '/token' ) ,
69+ success : function ( data , textStatus , xhr ) {
70+ $ ( '#hub_app_access_token' ) . val ( '' ) ;
71+ set_visibility ( ) ;
72+ }
73+ } ) ;
74+ }
75+
6276 function webhook_create ( ) {
6377 var repo_id = $ ( '#repo_id' ) . val ( ) ;
6478 var status_icon = $ ( '#webhook_status > i' ) ;
You can’t perform that action at this time.
0 commit comments