Skip to content

Commit 3f34e21

Browse files
committed
Make sure the users endpoint respects the window.ENV.server setting
1 parent 7eefde8 commit 3f34e21

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

app/controllers/registration.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
var RegistrationController = Em.Controller.extend({
22

33
actions: {
4-
4+
55
register: function() {
6-
6+
77
var data, _this;
88
_this = this;
99
data = this.getProperties("email", "password");
10-
10+
1111
return Em.$.ajax({
12-
12+
1313
method: "POST",
14-
url: "http://localhost:3000//users.json",
14+
url: window.ENV.server + "/users.json",
1515
dataType: 'json',
1616
data: {
1717
user: data
1818
}
19-
19+
2020
}).then((function(response) {
2121

2222
return Em.run((function() {
23-
23+
2424
console.log("Registration Suceeded!");
25-
25+
2626
_this.get('session').authenticate('authenticator:oauth2-password-grant', {
2727
identification: data.email,
2828
password: data.password
@@ -31,13 +31,13 @@ var RegistrationController = Em.Controller.extend({
3131
return _this.send("registrationSucceeded", response);
3232

3333
}));
34-
34+
3535
}), (function(xhr, status, error) {
36-
36+
3737
return Em.run((function() {
3838
return _this.send("registrationFailed", xhr, status, error);
3939
}));
40-
40+
4141
}));
4242

4343
},

0 commit comments

Comments
 (0)