Skip to content

Updating saved account #82

Open
Open
@mistenkt

Description

@mistenkt

If my token has expired, and my thirdparty service uses its refresh token to generate a new token, how can i update the managers saved account info?

the flow is like this

manager.authorize('provider')
    .then(res => {
            // this will use the saved account info
            api.auth(res.credentials.accessToken).then(apiRes => {
                // the api tries to use the provided access token to auth against the provider serverside, it sees that the token is expired and uses its refreshtoken to create a new one

                // apiRes returns user data including a new access token
                // when this refreshtoken differs from the one manager the managers saved account info should be updated so that next time it runs it uses the correct access token

                if(res.credentials.accessToken !== apiRes.accessToken) {
                    // Should update managers saved account info
                }
                
            })
        }

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