Skip to content

Commit d7e998e

Browse files
committed
Fix an unwanted page reload when entering username and password in the basic authentication form
Prevent the default hyperlink action.
1 parent 2274e0c commit d7e998e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/javascript/view/BasicAuthButton.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ SwaggerUi.Views.BasicAuthButton = Backbone.View.extend({
2020
'click #apply_basic_auth' : 'applyPassword'
2121
},
2222

23-
applyPassword: function(){
23+
applyPassword: function(event){
24+
event.preventDefault();
2425
var username = $('#input_username').val();
2526
var password = $('#input_password').val();
2627
var basicAuth = new SwaggerClient.PasswordAuthorization('basic', username, password);

0 commit comments

Comments
 (0)