Skip to content

Error Occurring Using Parse.Cloud.beforeLogin #5998

Closed
@KAIOAVILA

Description

@KAIOAVILA

Issue Description

I'm implementing a check to make sure the user can sign in to the app, but an error occurs while trying to log in to the app.

For the error to occur, the class User must have a column with file and the record must have some file, if null works normally

Steps to reproduce

Cloud implementation code snippet

Parse.Cloud.beforeLogin(async request => {
    const { object: user }  = request;
    if(user.get('deletedAt')) {
        throw 'Access denied, you have been banned.';
    }
    
});

3|AP | Error: Tried to encode an unsaved file. 3|AP | at encode (/home/user/api/parse-api/node_modules/parse/lib/node/encode.js:73:13) 3|AP | at _default (/home/user/api/parse-api/node_modules/parse/lib/node/encode.js:126:10) 3| AP | at ParseUser.toJSON (/home/user/api/parse-api/node_modules/parse/lib/node/ParseObject.js:578:42) 3| AP | at object (/home/user/api/parse-api/node_modules/parse-server/src/triggers.js:540:23) 3| AP | at success (/home/user/api/parse-api/node_modules/parse-server/src/triggers.js:273:14) 3|AP | at <anonymous>

I was checking and an error is occurring on the user who has a file and when doing the code he can't pass this point

Captura de Tela 2019-08-29 às 15 28 12

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions