angular-fullstack / generator-angular-fullstack

Yeoman generator for an Angular app with an Express server
https://awk34.gitbook.io/generator-angular-fullstack
6.12k stars 1.24k forks source link

upgrade via 'yo angular-fullstack existing-project' removes twitter/g+/fb auth #403

Closed sethlesky closed 10 years ago

sethlesky commented 10 years ago

I upgraded to 2.0.7 via yo. When doing an update of an existing project yo angular-fullstack existing-project and responding with Y to use the existing yo-rc.json the update tries to removes all functionality related to external auth (google/fb/twitter).

i.e in user.model.js

diff --git a/server/api/user/user.model.js b/server/api/user/user.model.js
index 009f289..f82ad18 100644
--- a/server/api/user/user.model.js
+++ b/server/api/user/user.model.js
@@ -4,8 +4,6 @@ var mongoose = require('mongoose');
 var Schema = mongoose.Schema;
 var crypto = require('crypto');

-var authTypes = ['github', 'twitter', 'facebook', 'google'];
-
 var UserSchema = new Schema({
   name: String,
   email: { type: String, lowercase: true },
@@ -15,11 +13,7 @@ var UserSchema = new Schema({
   },
   hashedPassword: String,
   provider: String,
-  salt: String,
-  facebook: {},
-  twitter: {},
-  github: {},
-  google: {}
+  salt: String
 });

My .yo-rc.json

{
  "generator-angular-fullstack": {
    "insertRoutes": true,
    "registerRoutesFile": "server/routes.js",
    "routesNeedle": "// Insert routes below",
    "insertSockets": true,
    "registerSocketsFile": "server/config/socketio.js",
    "socketsNeedle": "// Insert sockets below",
    "filters": {
      "js": true,
      "html": true,
      "less": true,
      "ngroute": true,
      "mongoose": true,
      "auth": true,
      "googleAuth": true,
      "facebookAuth": true,
      "twitterAuth": true
    }
  },
  "generator-ng-component": {
    "routeDirectory": "client/app/",
    "directiveDirectory": "client/app/",
    "filterDirectory": "client/app/",
    "serviceDirectory": "client/app/",
    "basePath": "client",
    "filters": [
      "ngroute"
    ],
    "extensions": [
      "js",
      "html",
      "less"
    ]
  }
}
sethlesky commented 10 years ago

After generating a project with the same configurations and using the new yo-rc.json it brought back twitter/fb/g+ auth. It seems that my old yo-rc.json was missing oauth: true.

meeDamian commented 10 years ago

Yes. I saw that too, I'll be sending PR fixing that later today.

meeDamian commented 10 years ago

@sethlesky See #407

sethlesky commented 10 years ago

Excellent. Thanks @chester1000