diff --git a/app/Http/Controllers/RegisteredUserController.php b/app/Http/Controllers/RegisteredUserController.php index 02329e2..8822582 100644 --- a/app/Http/Controllers/RegisteredUserController.php +++ b/app/Http/Controllers/RegisteredUserController.php @@ -1,13 +1,15 @@ is('register/promoter/*')) { $promoter = $request->route('promoter'); + + // TODO: store the code somewhere or do something with the promoter code here + // Since we do not want to allow users to edit this code we don't need to send it to the frontend + + // One idea is to store the respective promoter in cache (since we already use that) and provide the cache key to the View + // On submission, that same cache key will be used to associate a given promoter with the newly registered participant. + // Additional measures can be taken to ensure this system does not get exploited. + + Cookie::queue('', '', 3); } - // return app(RegisterViewResponse::class); - return Inertia::render('Auth/Register', [ - 'promoter' => $promoter, - ]); + return $response; } /** diff --git a/resources/js/Pages/Auth/Register.vue b/resources/js/Pages/Auth/Register.vue index 331ed3c..b95a647 100644 --- a/resources/js/Pages/Auth/Register.vue +++ b/resources/js/Pages/Auth/Register.vue @@ -6,18 +6,12 @@ import TextInput from "@/Components/TextInput.vue"; import CardLayout from "../../Layouts/CardLayout.vue"; import route from "ziggy-js"; -interface Props { - promoter?: string; -} - -const props = defineProps(); - const form = useForm({ name: "", email: "", password: "", password_confirmation: "", - promoter: props.promoter ?? "", + promoter: "", terms: false, }); @@ -72,15 +66,6 @@ const submit = () => { :error-message="form.errors.password_confirmation" /> - -