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
bd9aa01a
authored
2016-08-05 16:43:56 -0500
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Remove app, remove syncMixin; wrapSync now takes an auth parameter.
1 parent
fb7b1114
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
src/scripts/Auth.js
src/scripts/Auth.js
View file @
bd9aa01
...
...
@@ -32,12 +32,12 @@ define(function(require) {
return
deferred
;
}
var
authSync
=
function
authSync
(
origSync
,
method
,
model
,
options
)
{
var
authSync
=
function
authSync
(
auth
,
origSync
,
method
,
model
,
options
)
{
var
args
=
_
.
toArray
(
arguments
);
args
.
shift
();
var
url
=
options
.
url
||
_
.
result
(
model
,
'url'
);
if
(
url
)
{
var
sessionId
=
a
pp
.
get
(
'auth'
)
.
get
(
'sessionId'
);
var
sessionId
=
a
uth
.
get
(
'sessionId'
);
if
(
sessionId
)
{
options
.
url
=
url
+
(
url
.
indexOf
(
'?'
)
==
-
1
?
'?'
:
'&'
)
+
'sessionId='
+
sessionId
;
}
...
...
@@ -268,15 +268,11 @@ define(function(require) {
},
{
FacebookProvider
:
FacebookProvider
,
FormProvider
:
FormProvider
,
wrapSync
:
function
(
origSync
)
{
wrapSync
:
function
(
auth
,
origSync
)
{
return
function
()
{
return
authSync
.
apply
(
this
,
[
origSync
].
concat
(
_
.
toArray
(
arguments
)));
return
authSync
.
apply
(
this
,
[
auth
,
origSync
].
concat
(
_
.
toArray
(
arguments
)));
};
},
syncMixin
:
function
(
Class
)
{
Class
.
prototype
.
sync
=
Auth
.
wrapSync
(
Class
.
prototype
.
sync
);
return
Class
;
},
});
return
Auth
;
});
...
...
Please
register
or
sign in
to post a comment