[auth] Added logout for auth with apiKey and basic auth

This commit is contained in:
bodnia
2016-03-07 21:14:55 +02:00
committed by Anna Bodnia
parent 8280cc6b34
commit 67881fb07e
15 changed files with 170 additions and 60 deletions
+7 -1
View File
@@ -3,7 +3,8 @@
SwaggerUi.Views.ApiKeyButton = Backbone.View.extend({ // TODO: append this to global SwaggerUi
events:{
'click .auth_submit_button' : 'applyApiKey'
'click .auth_submit_button' : 'applyApiKey',
'click .auth_logout__button' : 'clickLogout'
},
template: Handlebars.templates.apikey_button_view,
@@ -28,6 +29,11 @@ SwaggerUi.Views.ApiKeyButton = Backbone.View.extend({ // TODO: append this to gl
);
this.router.api.clientAuthorizations.add(this.model.name, keyAuth);
this.router.load();
},
clickLogout: function () {
window.swaggerUi.api.clientAuthorizations.remove(this.model.name);
this.remove();
}
});