openknowledge-archive / dpr-api

DEPRECATED - Data Package Registry API and Frontend
http://frictionlessdata.io/
MIT License
7 stars 6 forks source link

Get rid of duplicated roundtrip to authenticate user. #232

Closed Fak3 closed 7 years ago

Fak3 commented 7 years ago

Right now we store jwt token in browser localstore after login. So our authentication process would look like this:

Not only this creates double reoundrip to the server and percieved slowness of the pageload, but also it is complicated to implement correctly and just a bad design.

We can get rid of extra roundtrip if we store the auth credentials in the cookies. We can store jwt there, but it will be much harder to implement than using ready solutions like flask-login or flask-security,

Acceptance criteria

Tasks

Analysis

Exploring the code history, this issue was fixed back in march in this commit https://github.com/frictionlessdata/dpr-api/commit/5fe695f131656c0bd87cc05537470ffe053c4251

To be exact adding the get_user_from_cookie() method to __init__.py.

Also see discussion here https://github.com/frictionlessdata/dpr-api/issues/292

rufuspollock commented 7 years ago

@subhankarb can you comment on this:

zelima commented 7 years ago

FIXED / DUPLICATE was fixed with #292