Commit 3aafe321bff58b10c7f719c1168df6899875499c
1 parent
879c146b
Exists in
master
Ajuste no nome do atributo de sessão
Showing
4 changed files
with
10 additions
and
10 deletions
Show diff stats
archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/bookmark-edit.js
archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/controller/login.js
... | ... | @@ -24,7 +24,7 @@ function make_base_auth(user, password) { |
24 | 24 | // Funções de Callback |
25 | 25 | |
26 | 26 | function loginOk(data) { |
27 | - sessionStorage.setItem('credential', make_base_auth($("#username").val().trim(), $("#password").val().trim())); | |
27 | + sessionStorage.setItem('credentials', make_base_auth($("#username").val().trim(), $("#password").val().trim())); | |
28 | 28 | location.href = "bookmark-list.html"; |
29 | 29 | } |
30 | 30 | ... | ... |
archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/proxy/auth.js
... | ... | @@ -31,6 +31,6 @@ AuthProxy.getUser = function($success, $error) { |
31 | 31 | }); |
32 | 32 | }; |
33 | 33 | |
34 | -AuthProxy.getCredential = function(){ | |
35 | - return sessionStorage.getItem('credential'); | |
34 | +AuthProxy.getCredentials = function(){ | |
35 | + return sessionStorage.getItem('credentials'); | |
36 | 36 | } |
37 | 37 | \ No newline at end of file | ... | ... |
archetype/html-rest/src/main/resources/archetype-resources/src/main/webapp/js/proxy/bookmark.js
... | ... | @@ -28,8 +28,8 @@ BookmarkProxy.insert = function($form, $success, $error) { |
28 | 28 | contentType : "application/json", |
29 | 29 | success : $success, |
30 | 30 | error : $error, |
31 | - beforeSend: function (xhr) { | |
32 | - xhr.setRequestHeader ("Authorization", AuthProxy.getCredential()); | |
31 | + beforeSend : function(xhr) { | |
32 | + xhr.setRequestHeader("Authorization", AuthProxy.getCredentials()); | |
33 | 33 | } |
34 | 34 | }); |
35 | 35 | }; |
... | ... | @@ -42,8 +42,8 @@ BookmarkProxy.update = function($id, $form, $success, $error) { |
42 | 42 | contentType : "application/json", |
43 | 43 | success : $success, |
44 | 44 | error : $error, |
45 | - beforeSend: function (xhr) { | |
46 | - xhr.setRequestHeader ("Authorization", AuthProxy.getCredential()); | |
45 | + beforeSend : function(xhr) { | |
46 | + xhr.setRequestHeader("Authorization", AuthProxy.getCredentials()); | |
47 | 47 | } |
48 | 48 | }); |
49 | 49 | }; |
... | ... | @@ -56,8 +56,8 @@ BookmarkProxy.remove = function($ids, $success, $error) { |
56 | 56 | contentType : "application/json", |
57 | 57 | success : $success, |
58 | 58 | error : $error, |
59 | - beforeSend: function (xhr) { | |
60 | - xhr.setRequestHeader ("Authorization", AuthProxy.getCredential()); | |
59 | + beforeSend : function(xhr) { | |
60 | + xhr.setRequestHeader("Authorization", AuthProxy.getCredentials()); | |
61 | 61 | } |
62 | 62 | }); |
63 | 63 | }; | ... | ... |