-
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Google, Facebook, and Email API endpoints for authentication, r…
…efactored an extensive amount of code
- Loading branch information
1 parent
8864955
commit 750b328
Showing
32 changed files
with
605 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
// # api | ||
|
||
exports = module.exports = function() { | ||
|
||
function login(req, res, next) { | ||
res.json(req.user); | ||
} | ||
|
||
function updateUser(req, res, next) { | ||
// we are simply re-using eskimo's default | ||
// user update method in the users controller | ||
// that ships with eskimo; just to save time | ||
// we are manually setting the id param here | ||
// and then calling `next()` to continue along | ||
req.params.id = req.user.id; | ||
next(); | ||
} | ||
|
||
return { | ||
login: login, | ||
updateUser: updateUser | ||
}; | ||
|
||
}; | ||
|
||
exports['@singleton'] = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
(function(window) { | ||
|
||
// Remove the ugly Facebook appended hash | ||
// <https://github.com/jaredhanson/passport-facebook/issues/12> | ||
(function removeFacebookAppendedHash() { | ||
if (!window.location.hash || window.location.hash !== '#_=_') | ||
return; | ||
if (window.history && window.history.replaceState) | ||
return window.history.replaceState("", document.title, window.location.pathname); | ||
// Prevent scrolling by storing the page's current scroll offset | ||
var scroll = { | ||
top: document.body.scrollTop, | ||
left: document.body.scrollLeft | ||
}; | ||
window.location.hash = ""; | ||
// Restore the scroll offset, should be flicker free | ||
document.body.scrollTop = scroll.top; | ||
document.body.scrollLeft = scroll.left; | ||
}()); | ||
|
||
}(window)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
|
||
(function(window, $) { | ||
'use strict'; | ||
|
||
$(function() { | ||
}); | ||
//$(function() { | ||
//}); | ||
|
||
}(window, jQuery)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
// Avoid `console` errors in browsers that lack a console. | ||
(function(window) { | ||
'use strict'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.