Login window instead of WWW-Authenticate#1301
Conversation
84d3dc9 to
72c19ea
Compare
www/style/login.css
Outdated
| font-size: 12pt; | ||
| display: inline-block; | ||
| margin-bottom: 18px; | ||
| } No newline at end of file |
There was a problem hiding this comment.
No new line at the end of file.
www/scripts/login/login.js
Outdated
| document.body.appendChild(layout.domNode); | ||
| layout.startup(); | ||
| }; | ||
| }); No newline at end of file |
There was a problem hiding this comment.
No new line at the end of this file.
www/login.html
Outdated
| <!-- CSS --> | ||
|
|
||
| <link type="text/css" rel="stylesheet" href="scripts/plugins/dojo/dijit/themes/claro/claro.css" /> | ||
| <link type="text/css" rel="stylesheet" href="scripts/plugins/dojo/dojox/form/resources/CheckedMultiSelect.css"/> |
There was a problem hiding this comment.
Do not import CheckedMultiSelect, claroGrid, jsPlumb, marked.min. We do not use these at the login page.
|
|
||
| this.btnSubmit = new Button({ | ||
| label : "Login", | ||
| onClick : function () { |
There was a problem hiding this comment.
It would be great to fire this event by pressing ENTER button.
|
Login in and after log out from the product page will result a blank page. |
72c19ea to
d01d8eb
Compare
d01d8eb to
d3b7c7c
Compare
|
Rebased TOT for the minor refactoring work introduced in #1172. |
libcodechecker/server/server.py
Outdated
|
|
||
| product_endpoint, path = routing.split_client_GET_request(self.path) | ||
|
|
||
| if self.server.manager.isEnabled() and not auth_session \ |
There was a problem hiding this comment.
SessionManager instance has no attribute 'isEnabled'Use is_enabled property instead of this.
www/scripts/login/login.js
Outdated
| this.btnSubmit = new Button({ | ||
| label : "Login", | ||
| onClick : function () { | ||
| that._doLogin(); |
There was a problem hiding this comment.
If the login has failed, do not clear the username field and put the focus on the password input field.
There was a problem hiding this comment.
If I click on the login button the authentication takes too much time. It would be great to use a dojo stand by (https://dojotoolkit.org/reference-guide/1.10/dojox/widget/Standby.html) to show that the operation is in process.
There was a problem hiding this comment.
First comment fixed.
Second I will look into later, no time to do right now. Also, should the authentication really be that slow?
www/scripts/login/login.js
Outdated
| region : 'center', | ||
| postCreate : function () { | ||
| var smallerContainer = domConstruct.create('div', { | ||
| class : 'login-form' |
There was a problem hiding this comment.
Use id instead of class
www/style/login.css
Outdated
| @@ -0,0 +1,15 @@ | |||
| .login-form { | |||
There was a problem hiding this comment.
Use this:
#login-form {
display: block;
position: relative;
top: 25%;
margin: 0 auto;
width: 20%;
background-color: #edf4fa;
border: 1px solid;
border-color: #e5e6e9 #dfe0e4 #d0d1d5;
border-radius: 5px;
}
#login-form .mbox.mbox-error {
background-color: white;
}
#login-form .login-prompt {
font-weight: bold;
font-size: 12pt;
display: inline-block;
margin-bottom: 18px;
}
#login-form .formElement .form-input {
width: 100%;
}There was a problem hiding this comment.
You can use the min-width css property to set a minimal width for the login form.
www/scripts/login/login.js
Outdated
|
|
||
| var that = this; | ||
| function keypressHandler(evt) { | ||
| if (evt.keyCode === keys.ENTER) { |
There was a problem hiding this comment.
Problem on login:
- Type the username
- Type the password
- Hit enter
The login failed because the password wasn't set properly:
[1, "performLogin", 1, 0, {1: {str: "Username:Password"}, 2: {str: "test:"}}]| <link type="text/css" rel="stylesheet" href="scripts/plugins/dojo/dijit/themes/claro/claro.css" /> | ||
| <link type="text/css" rel="stylesheet" href="style/codecheckerviewer.css" /> | ||
| <link type="text/css" rel="stylesheet" href="style/login.css" /> | ||
| <link type="text/css" rel="stylesheet" href="style/productlist.css" /> |
There was a problem hiding this comment.
Why does the login use the productlist css?
There was a problem hiding this comment.
The styles for formElement and form-input are defined in the productlist.css file.
d3b7c7c to
b15a7dd
Compare
b15a7dd to
ae3405d
Compare


Instead of prompting the user for
WWW-Authenticate(the normal browser popup window authentication), use a facade put together in Dojo to ask for user credentials. This way, it is the Thrift API that handles the login of the user, the same way the command-line client does it.Browsers cache the credentials of a
Authenticateheader which is very hacky to remove. Thanks to dropping that whole functionality, we can now introduce a Log out feature, which this patch also does.