add a sample AuthorizationServer to the repo and put traffic-police app in a separate folder

This commit is contained in:
Muhammad Azeez
2021-01-16 21:20:05 +03:00
parent 91810950db
commit 85cd111f5f
201 changed files with 10992 additions and 16 deletions

View File

@@ -0,0 +1,38 @@
import {
USER_SIGNED_OUT,
STORE_USER_ERROR,
USER_EXPIRED,
STORE_USER,
LOADING_USER
} from '../actions/types'
const initialState = {
user: null,
isLoadingUser: false
};
export default function (state = initialState, action) {
switch (action.type) {
case STORE_USER:
return {
...state,
isLoadingUser: false,
user: action.payload
}
case LOADING_USER:
return {
...state,
isLoadingUser: true
}
case USER_EXPIRED:
case STORE_USER_ERROR:
case USER_SIGNED_OUT:
return {
...state,
user: null,
isLoadingUser: false
}
default:
return state
}
}

View File

@@ -0,0 +1,6 @@
import { combineReducers } from 'redux';
import authReducer from './authReducer';
export default combineReducers({
auth: authReducer
})