Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
frontend-auth
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
d5be3c7a
authored
2016-08-01 18:03:38 -0500
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Deal with an errorMessage being sent, by copying it into the model.
1 parent
aef73065
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
src/scripts/Auth.js
src/scripts/Auth.js
View file @
d5be3c7
...
...
@@ -199,7 +199,13 @@ define(function(require) {
}
function
api
(
apiName
,
data
)
{
var
apiHandler
=
globalOptions
.
api
||
function
(
apiName
,
data
)
{};
return
apiHandler
(
apiName
,
data
,
{
sessionId
:
self
.
get
(
'sessionId'
)}).
done
(
applyLoginResults
);
return
apiHandler
(
apiName
,
data
,
{
sessionId
:
self
.
get
(
'sessionId'
)}).
always
(
function
()
{
self
.
unset
(
'errorMessage'
);
}).
done
(
applyLoginResults
).
error
(
function
(
xhr
)
{
if
(
xhr
.
responseJSON
&&
xhr
.
responseJSON
.
errorMessage
)
{
self
.
set
(
'errorMessage'
,
xhr
.
responseJSON
.
errorMessage
);
}
});
}
var
addProviderData
=
_
.
bind
(
function
addProviderData
()
{
var
args
=
_
.
toArray
(
arguments
);
...
...
Please
register
or
sign in
to post a comment