Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(771)

Unified Diff: remoting/webapp/me2mom/remoting.js

Issue 7048020: Don't use letters in me2mom access code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/auth_token_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/me2mom/remoting.js
diff --git a/remoting/webapp/me2mom/remoting.js b/remoting/webapp/me2mom/remoting.js
index 656aa15ad8e3d1a75a7399a42c3ca08f5129654a..76dd63f224e77c4ba8ad677f66402677b95c11a6 100644
--- a/remoting/webapp/me2mom/remoting.js
+++ b/remoting/webapp/me2mom/remoting.js
@@ -263,6 +263,12 @@ function parseServerResponse_(xhr) {
showConnectError_(xhr.status, xhr.responseText);
}
+function normalizeAccessCode(accessCode) {
+ // Trim whitespace from beginning and the end.
+ // TODO(sergeyu): Do we need to do any other normalization here?
+ return accessCode.replace(/^\s+|\s+$/, '');
+}
+
function resolveSupportId(support_id) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
@@ -282,7 +288,7 @@ function resolveSupportId(support_id) {
}
function tryConnect(form) {
- remoting.accessCode = form['access_code_entry'].value;
+ remoting.accessCode = normalizeAccessCode(form['access_code_entry'].value);
// TODO(jamiewalch): Since the mapping from (SupportId, HostSecret) to
// AccessCode is not yet defined, assume it's hyphen-separated for now.
var parts = remoting.accessCode.split('-');
« no previous file with comments | « remoting/protocol/auth_token_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698