Fix broken token authentication #2113

Closed
tae wants to merge 0 commits from gitlab-mr-iid-846 into develop
Member
No description provided.
Member

there's no state.token and appToken should probably not be cleared

there's no `state.token` and `appToken` should probably not be cleared
Author
Member

c21ed4e9cb/src/modules/oauth.js (L33-35)

    getToken: state => () => {
      // state.token is userToken with older name, coming from persistent state
      // added here for smoother transition, otherwise user will be logged out
      return state.userToken || state.token || state.appToken
    },
    getUserToken: state => () => {
      // state.token is userToken with older name, coming from persistent state
      // added here for smoother transition, otherwise user will be logged out
      return state.userToken || state.token
    }

state.token is still being used as a fallback. It should be cleared as well.

https://git.pleroma.social/pleroma/pleroma-fe/blob/c21ed4e9cb780165bae2e4fda8ddeb2558c1fa8e/src/modules/oauth.js#L33-35 ``` getToken: state => () => { // state.token is userToken with older name, coming from persistent state // added here for smoother transition, otherwise user will be logged out return state.userToken || state.token || state.appToken }, getUserToken: state => () => { // state.token is userToken with older name, coming from persistent state // added here for smoother transition, otherwise user will be logged out return state.userToken || state.token } ``` `state.token` is still being used as a fallback. It should be cleared as well.
Member

then clear it properly then?

i.e. delete the property? just do it properly with vuex

and add a comment that we are clearing the fallback

then clear it properly then? i.e. delete the property? just do it properly with vuex and add a comment that we are clearing the fallback
Author
Member

sure, updated. 👍

sure, updated. :thumbsup:
Author
Member

@hj bump

@hj bump

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pleroma/pleroma-fe!2113
No description provided.