client/src/actions/authActions.js
author Alexandre Segura <mex.zktk@gmail.com>
Tue, 20 Jun 2017 16:08:12 +0200
changeset 63 4088f8dc6b52
parent 52 96f8a4a59bd9
child 89 06f609adfbf8
permissions -rw-r--r--
Improve session page layout, introduce summary.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44
3b20e2b584fe Introduce authentication through API.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     1
import * as types from '../constants/actionTypes';
3b20e2b584fe Introduce authentication through API.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     2
3b20e2b584fe Introduce authentication through API.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     3
export const loginSubmit = (username, password) => {
3b20e2b584fe Introduce authentication through API.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     4
  return {
3b20e2b584fe Introduce authentication through API.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     5
    type: types.AUTH_LOGIN_SUBMIT,
3b20e2b584fe Introduce authentication through API.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     6
    username,
3b20e2b584fe Introduce authentication through API.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     7
    password
3b20e2b584fe Introduce authentication through API.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     8
  };
3b20e2b584fe Introduce authentication through API.
Alexandre Segura <mex.zktk@gmail.com>
parents:
diff changeset
     9
}
52
96f8a4a59bd9 Implement logout.
Alexandre Segura <mex.zktk@gmail.com>
parents: 44
diff changeset
    10
96f8a4a59bd9 Implement logout.
Alexandre Segura <mex.zktk@gmail.com>
parents: 44
diff changeset
    11
export const logout = () => {
96f8a4a59bd9 Implement logout.
Alexandre Segura <mex.zktk@gmail.com>
parents: 44
diff changeset
    12
  return {
96f8a4a59bd9 Implement logout.
Alexandre Segura <mex.zktk@gmail.com>
parents: 44
diff changeset
    13
    type: types.AUTH_LOGOUT
96f8a4a59bd9 Implement logout.
Alexandre Segura <mex.zktk@gmail.com>
parents: 44
diff changeset
    14
  };
96f8a4a59bd9 Implement logout.
Alexandre Segura <mex.zktk@gmail.com>
parents: 44
diff changeset
    15
}