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

This commit is contained in:
bodnia
2016-03-02 01:04:56 +02:00
committed by Anna Bodnia
parent 5f64b49de9
commit ec3e5cae55
15 changed files with 170 additions and 60 deletions

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();
}
});