diff --git a/readme.md b/readme.md index 60bda5b..6ec6d71 100644 --- a/readme.md +++ b/readme.md @@ -6,4 +6,4 @@ Lucifer is a web interface for controlling Phillips Hue bulbs and providing acce * `cmd/`: The CLI entry points. * `models`: The models and their repository interfaces. * `database/`: Repository implementations for the various models. -* `webui/`: React client. \ No newline at end of file +* `webui/`: React client. diff --git a/webui/src/Actions/authActions.js b/webui/src/Actions/authActions.js new file mode 100644 index 0000000..d1239e3 --- /dev/null +++ b/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()); + + +}; diff --git a/webui/src/Reducers/authReducer.js b/webui/src/Reducers/authReducer.js index 38bc94b..78876de 100644 --- a/webui/src/Reducers/authReducer.js +++ b/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; \ No newline at end of file +export default authReducer;