Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not all fields copied #68

Open
topilski opened this issue Jun 11, 2017 · 2 comments
Open

Not all fields copied #68

topilski opened this issue Jun 11, 2017 · 2 comments

Comments

@topilski
Copy link

topilski commented Jun 11, 2017

Hi, i have User table which have inner password and email fields, when created temp record i see next:
image

my user scheme is:

var userSchema = mongoose.Schema({
    local            : {
        email        : String,
        password     : String
    },
    facebook         : {
        id           : String,
        token        : String,
        email        : String,
        name         : String
    },
    twitter          : {
        id           : String,
        token        : String,
        displayName  : String,
        username     : String
    },
    google           : {
        id           : String,
        token        : String,
        email        : String,
        name         : String
    },
    
    name : String,
    created_date : Date,
    offical_channels : [{type: mongoose.Schema.Types.ObjectId, ref: 'Channel'}],
    private_channels : [{type: mongoose.Schema.Types.ObjectId, ref: 'Channel'}],
    private_pool_channels : [ChannelSchema]
});

Why not inserted local.password and local.email? How i can retrive email/password when user clicked on activation link, after user click i want to save new entry into primary table.

@charisTheo
Copy link
Contributor

charisTheo commented Jul 9, 2017

I had the same problem and in end I had to rewrite the confirmTempUser() function :/
The issue is in the line 361 of index.js:
if (tempUserData) {
var userData = JSON.parse(JSON.stringify(tempUserData))

when I log the userData variable after conversion I get only two properties:
{ _id: '59621ca4e6b6c851478d6f4d', email: 'example@gmail.com' }

@frankcash
Copy link
Collaborator

@charisTheo if you supply a pull request I'd love to accept it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants