| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview Polymer element for displaying AD domain joining and AD | 6 * @fileoverview Polymer element for displaying AD domain joining and AD |
| 7 * Authenticate user screens. | 7 * Authenticate user screens. |
| 8 */ | 8 */ |
| 9 // Possible error states of the screen. Must be in the same order as | 9 // Possible error states of the screen. Must be in the same order as |
| 10 // ActiveDirectoryErrorState enum values. | 10 // ActiveDirectoryErrorState enum values. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 case ACTIVE_DIRECTORY_ERROR_STATE.BAD_PASSWORD: | 117 case ACTIVE_DIRECTORY_ERROR_STATE.BAD_PASSWORD: |
| 118 this.$.passwordInput.isInvalid = true; | 118 this.$.passwordInput.isInvalid = true; |
| 119 break; | 119 break; |
| 120 } | 120 } |
| 121 }, | 121 }, |
| 122 | 122 |
| 123 /** @private */ | 123 /** @private */ |
| 124 onSubmit_: function() { | 124 onSubmit_: function() { |
| 125 if (this.showMachineInput && !this.$.machineNameInput.checkValidity()) | 125 if (this.showMachineInput && !this.$.machineNameInput.checkValidity()) |
| 126 return; | 126 return; |
| 127 if (!this.$.userInput.checkValidity()) |
| 128 return; |
| 127 if (!this.$.passwordInput.checkValidity()) | 129 if (!this.$.passwordInput.checkValidity()) |
| 128 return; | 130 return; |
| 129 var user = /** @type {string} */ (this.$.userInput.value); | 131 var user = /** @type {string} */ (this.$.userInput.value); |
| 130 if (!user.includes('@') && this.userRealm) | 132 if (!user.includes('@') && this.userRealm) |
| 131 user += this.userRealm; | 133 user += this.userRealm; |
| 132 var msg = { | 134 var msg = { |
| 133 'machinename': this.$.machineNameInput.value, | 135 'machinename': this.$.machineNameInput.value, |
| 134 'username': user, | 136 'username': user, |
| 135 'password': this.$.passwordInput.value | 137 'password': this.$.passwordInput.value |
| 136 }; | 138 }; |
| 137 this.$.passwordInput.value = ''; | 139 this.$.passwordInput.value = ''; |
| 138 this.fire('authCompleted', msg); | 140 this.fire('authCompleted', msg); |
| 139 }, | 141 }, |
| 140 }); | 142 }); |
| OLD | NEW |