Add access code gate to boat charging - #596
Open
WouterAms wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds access-code protection to authenticated boat-charging flows and centralizes login-step state.
Changes:
- Adds boat-charging login, access-code setup, recovery, and redirect handling.
- Moves module login-step state into the access-code slice.
- Refactors the shared access-code gate into state, context, and provider components.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/modules/parking/Stack.tsx |
Uses centralized login-step state. |
src/modules/parking/slice.ts |
Removes local login-step state. |
src/modules/parking/screens/LoginSteps.screen.tsx |
Uses the shared login-step hook. |
src/modules/parking/components/ActionButton.tsx |
Reads centralized login-step state. |
src/modules/city-pass/Stack.tsx |
Uses centralized login-step state. |
src/modules/city-pass/slice.ts |
Removes local login-step state. |
src/modules/city-pass/screens/LoginSteps.screen.tsx |
Uses the shared login-step hook. |
src/modules/city-pass/hooks/useLoginSteps.ts |
Removes the module-specific hook. |
src/modules/boat-charging/Stack.tsx |
Integrates the access-code gate and pending routes. |
src/modules/boat-charging/slice.ts |
Stores pending post-login navigation. |
src/modules/boat-charging/screens/LoginSteps.screen.tsx |
Adds boat-charging access-code setup steps. |
src/modules/boat-charging/screens/BoatChargingLogin.screen.tsx |
Adds post-login navigation behavior. |
src/modules/boat-charging/screens/BoatChargingForgotAccessCode.screen.tsx |
Adds access-code recovery UI. |
src/modules/boat-charging/screenConfig.ts |
Excludes gate-owned routes from standard configuration. |
src/modules/boat-charging/routes.ts |
Adds access-code flow routes. |
src/modules/boat-charging/components/history/BoatChargingHistoryLogin.tsx |
Queues history after login. |
src/modules/boat-charging/components/BoatChargingLoginForm.tsx |
Delegates post-login navigation. |
src/modules/boat-charging/components/BoatChargingGuestEmailForm.tsx |
Queues terms after login. |
src/modules/access-code/slice.ts |
Centralizes per-module login-step state. |
src/modules/access-code/screens/AccessCode.screen.tsx |
Uses gate context for recovery availability. |
src/modules/access-code/providers/AccessCodeGate.provider.tsx |
Provides access-code gate metadata. |
src/modules/access-code/providers/AccessCodeGate.context.ts |
Defines the gate context. |
src/modules/access-code/hooks/useLoginSteps.ts |
Supports module-specific login-step state. |
src/modules/access-code/hooks/useAccessCodeGateState.ts |
Encapsulates gate state selection. |
src/modules/access-code/hooks/useAccessCodeGateContext.ts |
Exposes gate context values. |
src/modules/access-code/hooks/useAccessCodeGate.tsx |
Refactors gate rendering and loading behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+17
to
+18
| if (canGoBack() && isLoggedIn) { | ||
| goBack() |
| /> | ||
| <EnterAccessCode /> | ||
| {prevModule !== ModuleSlug.user && ( | ||
| {!!hasForgotCodeScreen && ( |
Comment on lines
+1
to
+5
| import {ForgotAccessCodeScreen} from '@/modules/access-code/screens/ForgotAccessCodeScreen' | ||
|
|
||
| export const BoatChargingForgotAccessCodeScreen = () => ( | ||
| <ForgotAccessCodeScreen testID="BoatChargingForgotAccessCodeScreen" /> | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Test instructions
Other notes