Skip to content

parseUser.currentUser() & .getCurrentUserFromServer() #24

Closed
@ghost

Description

Hello,

I copy/paste the project example, put my applications constants.

I sign up a user and login it. (I have the user in database with the session, it's good)

I restart my application and do my own code :
checkCurrentUser() async { // Best practice for starting the app. This will check for a var user = ParseUser.currentUser(); user = await user.getCurrentUserFromServer(); print("user: $user"); }

But in my terminal, I have this :
I/flutter (13889): I/flutter (13889): ---- I/flutter (13889): Hello Flutter API Response (_User : ParseApiRQ.currentUser) : I/flutter (13889): Status Code: 200 I/flutter (13889): Payload: {objectId: LjTOWTPE8D, createdAt: 2019-01-10T12:51:19.140Z, email: [email protected], username: TestFlutter, updatedAt: 2019-01-10T12:51:19.140Z, ACL: {*: {read: true}, LjTOWTPE8D: {read: true, write: true}}, sessionToken: r:5f7045a813f163282ac8a765eabf8cb6, __type: Object, className: _User} I/flutter (13889): ---- I/flutter (13889): user: Username: null I/flutter (13889): Email Address:null

The problem is that it seems that the user is retrieved but when I print my user variable, it's null.

In advance, thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions