| Index: remoting/webapp/me2mom/remoting.js
|
| diff --git a/remoting/webapp/me2mom/remoting.js b/remoting/webapp/me2mom/remoting.js
|
| index 656aa15ad8e3d1a75a7399a42c3ca08f5129654a..7fb163926d947f588115c62da51e1ae5dc3f119b 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 normalizeAccessToken(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 = normalizeAccessToken(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('-');
|
|
|