diff --git a/apps/portal/src/app/features/auth/store/signup.slice.ts b/apps/portal/src/app/features/auth/store/signup.slice.ts new file mode 100644 index 000000000..7a315db11 --- /dev/null +++ b/apps/portal/src/app/features/auth/store/signup.slice.ts @@ -0,0 +1,33 @@ +import { createSlice, type PayloadAction } from '@reduxjs/toolkit'; + +interface SignupState { + email: string; + phoneNumber: string; + step: 'form' | 'otp' | 'complete'; +} + +const initialState: SignupState = { + email: '', + phoneNumber: '', + step: 'form', +}; + +const signupSlice = createSlice({ + name: 'signup', + initialState, + reducers: { + setSignupData(state, action: PayloadAction<{ email: string; phoneNumber: string }>) { + state.email = action.payload.email; + state.phoneNumber = action.payload.phoneNumber; + }, + setSignupStep(state, action: PayloadAction) { + state.step = action.payload; + }, + resetSignup() { + return initialState; + }, + }, +}); + +export const { setSignupData, setSignupStep, resetSignup } = signupSlice.actions; +export const signupReducer = signupSlice.reducer; diff --git a/apps/portal/src/app/router.tsx b/apps/portal/src/app/router.tsx index 8afae040e..a9f5eadeb 100644 --- a/apps/portal/src/app/router.tsx +++ b/apps/portal/src/app/router.tsx @@ -7,7 +7,7 @@ import { PortalLayout } from './layouts/PortalLayout'; // Auth (standalone pages, no portal chrome) import { LoginPage } from './features/auth/pages/LoginPage'; import { SignupPage } from './features/auth/pages/SignupPage'; -import { SetPasswordPage } from './features/auth/pages/SetPasswordPage'; +import { OTPVerificationPage } from './features/auth/pages/OTPVerificationPage'; // Portal feature pages import { DashboardPage } from './features/dashboard/pages/DashboardPage'; @@ -36,7 +36,7 @@ export const router = createBrowserRouter([ // Standalone auth pages { path: '/login', element: }, { path: '/signup', element: }, - { path: '/set-password', element: }, + { path: '/otp-verify', element: }, // Portal (open access for this UI template). // Wrapped in the portal's own i18n instance so it is isolated from the diff --git a/apps/portal/src/app/store/index.ts b/apps/portal/src/app/store/index.ts index bbfc3344f..a12829ad0 100644 --- a/apps/portal/src/app/store/index.ts +++ b/apps/portal/src/app/store/index.ts @@ -2,7 +2,6 @@ import { configureStore } from '@reduxjs/toolkit'; import { baseApi } from '@ema-platform/api'; import { authReducer } from '../features/auth/store/auth.slice'; import { signupReducer } from '../features/auth/store/signup.slice'; -import { setPasswordReducer } from '../features/auth/store/set-password.slice'; import { licensesReducer } from '../features/licenses/store/licenses.slice'; import { authStorage } from '../features/auth/utils/auth-storage'; @@ -19,7 +18,6 @@ export const store = configureStore({ reducer: { auth: authReducer, signup: signupReducer, - setPassword: setPasswordReducer, licenses: licensesReducer, [baseApi.reducerPath]: baseApi.reducer, },