17 Commits

Author SHA1 Message Date
Robert Schäfer
ea9f896ef8 Refactor store to use the new backend API 2019-02-27 11:06:02 +01:00
Robert Schäfer
34d79dfc64 Log out the user if fetchUser was unsuccessful 2019-02-27 10:45:46 +01:00
Robert Schäfer
b0262e9b76 Remove locationName and about
as default properties of the currentUser query.

We don't need it all the time. Somewhere in the frontend, the call to
`fetchCurrentUser` is abused to refresh some data of the user to be
edited.
2019-02-26 16:26:05 +01:00
Robert Schäfer
71ab2f3828 Get rid of JWT_SECRET once and for all
* refactor store/auth.js not to use `delete Object`
* refactor store/auth.js to have less redundancy
* implement fetchCurrentUser without knowing the id beforehand
* test fetchCurrentUser and init
2019-02-26 16:26:04 +01:00
Grzegorz Leoniec
bfee061a26
Added JWT_SECRET from env var 2019-01-09 17:22:02 +01:00
Grzegorz Leoniec
47c858d9d2
Improved locale handling 2019-01-04 15:03:35 +01:00
Grzegorz Leoniec
bbe1d4e7c3
merged master in 2018-12-29 16:09:06 +01:00
Robert Schäfer
16997ee63d Refactor login with confidence
This is why I ❤️ testing. First I wrote several tests to get
familiar with the existing code and specified everything that I believe to
be required. Then I refactor the entire method at once and the tests pass.

Note that I do **not** believe that setting the user data to `null` is
really relevant.
2018-12-19 18:04:25 +01:00
Robert Schäfer
b17686656b Test error path of #login procedure 2018-12-19 11:58:03 +01:00
Robert Schäfer
bf8f2f8877 Remove dead code 2018-12-19 11:11:12 +01:00
Robert Schäfer
d465db5906 Test store/auth#login 2018-12-19 11:11:12 +01:00
Robert Schäfer
01f5cfd481 Run yarn run lint --fix 2018-12-19 11:11:12 +01:00
Robert Schäfer
fec665eaf4 Implement+test auth.isAuthenticated() 2018-12-19 11:11:12 +01:00
Grzegorz Leoniec
68bce0c017
fixed user role check 2018-12-17 19:54:23 +01:00
Grzegorz Leoniec
f57c45bb3b added locations and about me text 2018-11-12 14:27:12 +01:00
Grzegorz Leoniec
76d607033f added user menu and fixed auth store 2018-10-30 18:40:04 +01:00
Grzegorz Leoniec
1735767cce added jwt login and authentication plus some toast 2018-10-17 19:57:24 +02:00