Browse Source

More stuff.

webui
Stian Aune 5 years ago
parent
commit
edd629eb39
  1. 2
      readme.md
  2. 10
      webui/src/Actions/authActions.js
  3. 9
      webui/src/Reducers/authReducer.js

2
readme.md

@ -6,4 +6,4 @@ Lucifer is a web interface for controlling Phillips Hue bulbs and providing acce
* `cmd/<name>`: The CLI entry points.
* `models`: The models and their repository interfaces.
* `database/<dbtype>`: Repository implementations for the various models.
* `webui/`: React client.
* `webui/`: React client.

10
webui/src/Actions/authActions.js

@ -0,0 +1,10 @@
import store from "../Reducers"
import {verificationStartedEvent} from "../Reducers/authReducer";
const dispatch = store.dispatch;
export const verify = () => {
dispatch(verificationStartedEvent());
};

9
webui/src/Reducers/authReducer.js

@ -10,7 +10,10 @@ const VERIFICATION_FAILED = "auth/verification/failed";
const authReducer = (state = initialState, {type, payload} = {}) => {
switch (type) {
case VERIFICATION_STARTED:
return initialState;
return {
isChecked: false,
isLoggedIn: false,
};
case VERIFICATION_SUCCESS:
return {
isChecked: true,
@ -19,7 +22,7 @@ const authReducer = (state = initialState, {type, payload} = {}) => {
case VERIFICATION_FAILED:
return {
isChecked: true,
isLoggedIn: true,
isLoggedIn: false,
};
default:
return state;
@ -30,4 +33,4 @@ export const verificationStartedEvent = () => ({ type: VERIFICATION_STARTED });
export const verificationSucceededEvent = () => ({ type: VERIFICATION_SUCCESS });
export const verificationFailedEvent = () => ({ type: VERIFICATION_FAILED });
export default authReducer;
export default authReducer;
Loading…
Cancel
Save