Permalink
Browse files

Changes per Anatoliy made

  • Loading branch information...
1 parent f294609 commit c42e1e93921290c6ac364892194c43c74ba72932 @whito committed Sep 5, 2012
Showing with 27 additions and 9 deletions.
  1. +19 −0 app/models/user.js
  2. +4 −4 config/environment.js
  3. +1 −1 config/passport.yml
  4. +3 −4 db/schema.js
View
@@ -0,0 +1,19 @@
+exports.findOrCreate = function (data, done) {
+
+ /* LOCAL */
+ if (data.email) {
+ User.all({
+ where: {
+ email: data.email
+ }, limit: 1
+ }, function (err, user) {
+ if (user[0]) return done(err, user[0]);
+ if (!user[0]) return done(err);
+ });
+ } else
+
+ /* SOMETHING NOT KNOWN YET */
+ {
+ console.log(data.profile);
+ }
+};
View
@@ -14,11 +14,11 @@ app.configure(function(){
app.use(express.session({secret: 'secret'}));
app.use(express.methodOverride());
// Passport ---------------------
- //rwps.init();
+ rwps.init();
// hook up user model
- //process.nextTick(function () {
- // rwps.loadUser(User);
- //});
+ process.nextTick(function () {
+ rwps.loadUser(User);
+ });
//------------------------------
app.use(app.router);
});
View
@@ -1,5 +1,5 @@
development:
baseURL: "http://localhost:3000/"
local:
- usernameField: "login"
+ usernameField: "email"
passwordField: "password"
View
@@ -22,9 +22,8 @@
*/
var User = describe('User', function () {
- property('login', String);
+ property('first_name', String);
+ property('last_name', String);
+ property('email', String);
property('password', String);
-});var Post = describe('Post', function () {
- property('name', String);
- property('content', String);
});

0 comments on commit c42e1e9

Please sign in to comment.