Skip to content

Commit 1adb670

Browse files
djmgitmariobehling
authored andcommitted
fiixes #109 - fixed account apps (#115)
fixed the following apps: signup app login app register public key app password recovery app view permissions app reset password app(not tested)
1 parent e510737 commit 1adb670

File tree

7 files changed

+26
-25
lines changed

7 files changed

+26
-25
lines changed

accountpermissions/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h3>Account information</h3>
6363
<div class="section" id="serviceList"><h3>List of services</h3></div>
6464
</div>
6565
<div id="notLoggedIn" class="hidden">
66-
<p>You are not logged in. <a href="/apps/loginpage">Click here to login</a></p>
66+
<p>You are not logged in. <a href="/loginpage">Click here to login</a></p>
6767
</div>
6868

6969
<!-- Bootstrap core JavaScript

accountpermissions/js/app.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
$(document).ready( function () {
22
$.ajax( "http://api.loklak.org/api/account-permissions.json", {
3-
dataType: "json",
3+
dataType: "jsonp",
44
success (response) {
55
$("#permissions").removeClass("hidden");
66
$("#userName").children().first().append(response.userName);
@@ -11,17 +11,17 @@ $(document).ready( function () {
1111
jQuery.each(response.userRoleSpecificPermissions, function(service, obj){
1212
$("#userRoleSpecificPermissions").append(service);
1313
});
14-
$("#ParentUserRole").children().first().append(response.userRole);
14+
$("#parentUserRole").children().first().append(response.userRole);
1515
},
1616
error (xhr, ajaxOptions, thrownError) {
1717
$("#notLoggedIn").removeClass("hidden");
1818
return;
1919
}
2020
});
2121

22-
$.ajax( "/api/account-permissions.json", {
22+
$.ajax( "http://api.loklak.org/api/account-permissions.json", {
2323
data: { getServiceList: true },
24-
dataType: "json",
24+
dataType: "jsonp",
2525
success (response) {
2626
jQuery.each(response.serviceList, function(i, service){
2727
$("#serviceList").append("<div class='service' id='" +
@@ -31,7 +31,7 @@ $(document).ready( function () {
3131
"</span><div class='serviceContent'\
3232
valueSet=false></div></div><br>");
3333
});
34-
}
34+
},
3535
});
3636

3737
$(document).on("click",".serviceTitle", function () {
@@ -40,9 +40,9 @@ $(document).ready( function () {
4040

4141
if(child.attr("valueSet") === "false"){
4242
child.hide();
43-
$.ajax( "/api/account-permissions.json", {
43+
$.ajax( "http://api.loklak.org/api/account-permissions.json", {
4444
data: { getServicePermissions: obj.attr("id") },
45-
dataType: "json",
45+
dataType: "jsonp",
4646
success (response) {
4747
if(Object.keys(response.servicePermissions).length > 0){
4848
child.append("<ul></ul>");

forgotpassword/js/passwordrecovery.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ $(document).ready(function () {
99
var mail = $('#email').val();
1010
$.ajax( "http://api.loklak.org/api/recoverpassword.json", {
1111
data: { forgotemail: mail },
12-
dataType: 'json',
12+
dataType: 'jsonp',
1313
success: function (response) {
1414
resetFields();
1515
$('#status-box').text(response.message);

keyRegistration/js/registration.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ $(document).ready(function () {
1212

1313
// get password parameters
1414
var regex;
15-
$.ajax( "/api/pubkey_registration.json", {
15+
$.ajax( "http://api.loklak.org/api/pubkey_registration.json", {
1616
data: { getParameters: true },
17-
dataType: 'json',
17+
dataType: 'jsonp',
1818
success: function (response) {
1919
if(response.self) {
2020
$('#status-box').text("");
@@ -116,9 +116,9 @@ $(document).ready(function () {
116116
}
117117
//console.log(data);
118118

119-
$.ajax( "/api/pubkey_registration.json", {
119+
$.ajax( "http://api.loklak.org/api/pubkey_registration.json", {
120120
data: data,
121-
dataType: 'json',
121+
dataType: 'jsonp',
122122
success: function (response) {
123123
//resetFields();
124124
$('#status-box').text(response.message);

loginpage/js/loginpage.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
$(document).ready(function () {
2-
$.ajax( "/api/login.json", {
2+
$.ajax( "http://api.loklak.org/api/login.json", {
33
data: { checkLogin: true },
4-
dataType: "json",
4+
dataType: "jsonp",
55
success: function (response) {
66
if(response.loggedIn) {
77
$("#status-box").text(response.message);
@@ -31,9 +31,9 @@ $(document).ready(function () {
3131
setRemember();
3232

3333
var optionsLogin = {
34-
url: "/api/login.json",
34+
url: "http://api.loklak.org/api/login.json",
3535
type: "get",
36-
dataType: "json",
36+
dataType: "jsonp",
3737
success(response) {
3838
window.location = "/apps/applist/index.html";
3939
},
@@ -49,9 +49,9 @@ $(document).ready(function () {
4949
});
5050

5151
var optionsLogout = {
52-
url: "/api/login.json",
52+
url: "http://api.loklak.org/api/login.json",
5353
type: "get",
54-
dataType: "json",
54+
dataType: "jsonp",
5555
success(response) {
5656
$("#loginForm").removeClass("hidden");
5757
$("#logoutForm").addClass("hidden");

resetpass/js/resetpass.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ $(document).ready(function () {
77

88
$.ajax( "http://api.loklak.org/api/recoverpassword.json", {
99
data: { getParameters: true, token: urltoken },
10-
dataType: 'json',
10+
dataType: 'jsonp',
1111
success: function (response) {
1212
regex = response.regex;
1313
var regexTooltip = response.regexTooltip;
@@ -21,6 +21,7 @@ $(document).ready(function () {
2121
$('#pass').prop( "disabled", true );
2222
$('#confirmpass').prop( "disabled", true );
2323
$('#resetbut').prop( "disabled", true );
24+
console.log(thrownError);
2425
tokenerr = true;
2526
},
2627
});
@@ -72,9 +73,9 @@ $(document).ready(function () {
7273
if(!total) {
7374
var newpass = $('#pass').val();
7475

75-
$.ajax( "/api/resetpassword.json", {
76+
$.ajax( "http://api.loklak.org/api/resetpassword.json", {
7677
data: { token: urltoken, newpass: newpass },
77-
dataType: 'json',
78+
dataType: 'jsonp',
7879
success: function (response) {
7980
resetFields();
8081
$('#status-box').text(response.message);

signup/js/signup.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ $(document).ready(function ()
33
// get password parameters
44
$.ajax( "http://api.loklak.org/api/signup.json", {
55
data: { getParameters: true },
6-
dataType: "json",
6+
dataType: "jsonp",
77
success: function (response) {
88
var regex = response.regex;
99
var regexTooltip = response.regexTooltip;
@@ -170,9 +170,9 @@ $(document).ready(function ()
170170
$("#confirmpass").keyup(function (){checkConfirmPass();});
171171

172172
var options = {
173-
url: "/api/signup.json",
173+
url: "http://api.loklak.org/api/signup.json",
174174
type: "get",
175-
dataType: "json",
175+
dataType: "jsonp",
176176
success(response) {
177177
resetFields();
178178
$("#status-box").text(response.message);

0 commit comments

Comments
 (0)