Store user token in cookies #2213

Closed
maxf wants to merge 1 commit from gitlab-mr-iid-946 into develop
Member

Rationale for this is to implement "single sign-on" between pleroma-fe and admin-fe.

When pleroma-fe and admin-fe are located under the same domain both apps would be able to read cookie named User-Token and use it to sign in.

If this will be merged I will first implement it in admin-fe, and then here (i.e. ability to sign in to pleroma-fe if user already signed in to admin-fe).

Rationale for this is to implement "single sign-on" between pleroma-fe and admin-fe. When pleroma-fe and admin-fe are located under the same domain both apps would be able to read cookie named `User-Token` and use it to sign in. If this will be merged I will first implement it in admin-fe, and then here (i.e. ability to sign in to pleroma-fe if user already signed in to admin-fe).
Author
Member

@rinpatch @shpuld @hj @lanodan could you guys take a look at this, please?

@rinpatch @shpuld @hj @lanodan could you guys take a look at this, please?
Member

you can read same local-storage as well from same domain, as far as I know, i'd prefer we use that instead.

you can read same local-storage as well from same domain, as far as I know, i'd prefer we use that instead.
Member

(or indexedDB, for that matter)

(or indexedDB, for that matter)
Author
Member

Got it

Got it
Member

@maxf we are using https://github.com/localForage/localForage for storing stuff including auth tokens, so it could be weird regarding where exactly it stores data, it tries to detect what browser supports or something. If it's inconvenient we could try stabilizing where stuff is stored, it's a bit messy with storage and multiple FEs.

@maxf we are using https://github.com/localForage/localForage for storing stuff including auth tokens, so it could be weird regarding where exactly it stores data, it tries to detect what browser supports or something. If it's inconvenient we could try stabilizing where stuff is stored, it's a bit messy with storage and multiple FEs.
Author
Member

I think that's fine for the first implementation, I'll just check whether there is "vuex-lz" key inside indexedDB, and if so, will try to fetch user token from there

I think that's fine for the first implementation, I'll just check whether there is "vuex-lz" key inside indexedDB, and if so, will try to fetch user token from there

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!2213
No description provided.