Problem Description
Login response function doesn’t work in ACS . Always its return an error.
[ERROR] :V8Exception: Exception occurred at undefined:1: Uncaught SyntaxError: Unexpected token
But the same code works as expected on iOS all and android GA version.
Affected Version: Android 3.3.0.RC
Testing Environment:
Titanium SDK: 3.3.0.RC,
Titanium CLI: 3.3.0 –rc,
Android SDK:4.2.2, 4,4,2
OS X Version: 10.9.3,
Appcelerator Studio: 3.2.3
Steps to reproduce:
1. Create a classic project.
2. Paste this code in app.js file.
3. Enable Cloud service.
4. At first create a user to the ACS.
4. Run this code with the testing environment.
var win = Ti.UI.createWindow({
backgroundColor : 'green'
});
var Cloud = require('ti.cloud');
function loginDefault() {
Cloud.Users.login({
login : "loginName",
password : 'pass'
}, function(e) {
if (e.success) {
var user = e.users[0];
alert('Success:\n' + 'id: ' + user.id + '\n' + 'sessionId: ' + Cloud.sessionId + '\n' + 'first name: ' + user.first_name + '\n' + 'last name: ' + user.last_name);
} else {
alert('Error:\n' + ((e.error && e.message) || JSON.stringify(e)));
}
});
}
// Create a Button.
var login = Ti.UI.createButton({
title : 'Login',
height : Ti.UI.SIZE,
width : Ti.UI.SIZE,
top : 100,
});
// Listen for click events.
login.addEventListener('click', function() {
loginDefault();
});
// Add to the parent view.
win.add(login);
win.open();
No comments