fixed caseing
This commit is contained in:
parent
b67da76dc6
commit
d53957ca6d
4 changed files with 7 additions and 7 deletions
|
|
@ -202,8 +202,8 @@ module.exports = (pool, query) => {
|
||||||
message: 'Login successful',
|
message: 'Login successful',
|
||||||
userId: userId,
|
userId: userId,
|
||||||
isAdmin: userInfo.rows[0].is_admin,
|
isAdmin: userInfo.rows[0].is_admin,
|
||||||
firstname: userInfo.rows[0].first_name,
|
firstName: userInfo.rows[0].first_name,
|
||||||
lastname: userInfo.rows[0].last_name,
|
lastName: userInfo.rows[0].last_name,
|
||||||
email: userInfo.rows[0].email,
|
email: userInfo.rows[0].email,
|
||||||
apiKey: apiKey
|
apiKey: apiKey
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@ export const authSlice = createSlice({
|
||||||
id: action.payload.user,
|
id: action.payload.user,
|
||||||
apiKey: action.payload.apiKey,
|
apiKey: action.payload.apiKey,
|
||||||
email: action.payload.email,
|
email: action.payload.email,
|
||||||
firstname: action.payload.firstname,
|
firstName: action.payload.firstName,
|
||||||
lastname: action.payload.lastname,
|
lastName: action.payload.lastName,
|
||||||
isAdmin: action.payload.isAdmin
|
isAdmin: action.payload.isAdmin
|
||||||
};
|
};
|
||||||
state.apiKey = action.payload.apiKey;
|
state.apiKey = action.payload.apiKey;
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ export const useVerifyCode = () => {
|
||||||
return useMutation({
|
return useMutation({
|
||||||
mutationFn: (verifyData) => authService.verifyCode(verifyData),
|
mutationFn: (verifyData) => authService.verifyCode(verifyData),
|
||||||
onSuccess: (data) => {
|
onSuccess: (data) => {
|
||||||
login(data.userId, data.apiKey, data.isAdmin, data.email, data?.firstname, data?.lastname);
|
login(data.userId, data.apiKey, data.isAdmin, data.email, data?.firstName, data?.lastName);
|
||||||
notification.showNotification('Login successful', 'success');
|
notification.showNotification('Login successful', 'success');
|
||||||
},
|
},
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
|
|
|
||||||
|
|
@ -74,10 +74,10 @@ export const useAuth = () => {
|
||||||
apiKey,
|
apiKey,
|
||||||
loading,
|
loading,
|
||||||
error,
|
error,
|
||||||
login: (user, apiKey, isAdmin, email, firstname = "", lastname = "") =>
|
login: (user, apiKey, isAdmin, email, firstName = "", lastName = "") =>
|
||||||
dispatch({
|
dispatch({
|
||||||
type: 'auth/loginSuccess',
|
type: 'auth/loginSuccess',
|
||||||
payload: { user, apiKey, isAdmin, email, firstname, lastname}}),
|
payload: { user, apiKey, isAdmin, email, firstName, lastName}}),
|
||||||
logout: () => dispatch({ type: 'auth/logout' }),
|
logout: () => dispatch({ type: 'auth/logout' }),
|
||||||
clearError: () => dispatch({ type: 'auth/clearError' }),
|
clearError: () => dispatch({ type: 'auth/clearError' }),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue