coopdevs / katuma-web

ABANDONED - Old Katuma's web interface
http://www.katuma.org
MIT License
7 stars 1 forks source link

Express sessions and API proxy #1

Closed enricostano closed 8 years ago

enricostano commented 8 years ago

Bringing back session management to Express

enricostano commented 8 years ago

I was trying to get rid of /me requests and to restore original /api/v1/login POST request without luck :disappointed:

diff --git a/src/redux/modules/auth.js b/src/redux/modules/auth.js
index 2fd2eef..30b8ddf 100644
--- a/src/redux/modules/auth.js
+++ b/src/redux/modules/auth.js
@@ -80,14 +80,14 @@ export function isLoaded(globalState) {
 export function load() {
   return {
     types: [LOAD, LOAD_SUCCESS, LOAD_FAIL],
-    promise: (client) => client.get('/me')
+    promise: (client) => client.get('/loadAuth')
   };
 }

 export function login(email, password) {
   return {
     types: [LOGIN, LOGIN_SUCCESS, LOGIN_FAIL],
-    promise: (client) => client.post('/login', {
+    promise: (client) => client.post('/api/v1/login', {
       data: {
         email: email,
         password: password
enricostano commented 8 years ago

@andresgutgon can we close this PR?

andresgutgon commented 8 years ago

yes