Skip to content

Commit c4b9aaf

Browse files
authored
feat: FE part of registrations should be put back (#2115)
* Revert changes for registration hiding * Update signup.tsx
1 parent 69b993b commit c4b9aaf

4 files changed

Lines changed: 21 additions & 50 deletions

File tree

packages/wallet/backend/src/app.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,7 @@ export class App {
189189
app.use(withSession)
190190

191191
// Auth Routes
192-
if (env.NODE_ENV !== 'production' || env.GATEHUB_ENV !== 'production') {
193-
router.post('/signup', authController.signUp)
194-
}
192+
router.post('/signup', authController.signUp)
195193
router.post('/login', rateLimiterLogin, authController.logIn)
196194
router.post('/logout', isAuth, authController.logOut)
197195

packages/wallet/frontend/src/pages/auth/index.tsx

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { NextPageWithLayout } from '@/lib/types/app'
44
import { Button } from '@/ui/Button'
55
import { Divider } from '@/ui/Divider'
66
import { Link } from '@/ui/Link'
7-
import { FEATURES_ENABLED, THEME } from '@/utils/constants'
7+
import { THEME } from '@/utils/constants'
88
import Image from 'next/image'
99

1010
const WelcomePage: NextPageWithLayout = () => {
@@ -20,19 +20,15 @@ const WelcomePage: NextPageWithLayout = () => {
2020
<Button aria-label="log in" href="auth/login">
2121
Log in
2222
</Button>
23-
{!FEATURES_ENABLED ? (
24-
<>
25-
<Divider content="or" />
26-
<h2 className="mb-5 text-xl font-semibold text-green dark:text-teal-neon">
27-
New here?
28-
</h2>
29-
<Button aria-label="sign up" href="auth/signup">
30-
Create account
31-
</Button>
32-
</>
33-
) : (
34-
<Divider />
35-
)}
23+
24+
<Divider content="or" />
25+
<h2 className="mb-5 text-xl font-semibold text-green dark:text-teal-neon">
26+
New here?
27+
</h2>
28+
<Button aria-label="sign up" href="auth/signup">
29+
Create account
30+
</Button>
31+
3632
<Image
3733
className="mt-10 object-cover md:hidden"
3834
src={imageName}

packages/wallet/frontend/src/pages/auth/login.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { ErrorDialog } from '@/components/dialogs/ErrorDialog'
1616
import { NextPageWithLayout } from '@/lib/types/app'
1717
import { useEffect, useState } from 'react'
1818
import { loginSchema } from '@wallet/shared'
19-
import { FEATURES_ENABLED, THEME } from '@/utils/constants'
19+
import { THEME } from '@/utils/constants'
2020

2121
const LoginPage: NextPageWithLayout = () => {
2222
const [openDialog, closeDialog] = useDialog()
@@ -158,14 +158,12 @@ const LoginPage: NextPageWithLayout = () => {
158158
/>
159159
</button>
160160
</Form>
161-
{!FEATURES_ENABLED ? (
162-
<p className="mt-auto text-center font-extralight text-green dark:text-green-neon">
163-
Not a customer?{' '}
164-
<Link href="signup" className="font-medium underline">
165-
Create an account
166-
</Link>
167-
</p>
168-
) : null}
161+
<p className="mt-auto text-center font-extralight text-green dark:text-green-neon">
162+
Not a customer?{' '}
163+
<Link href="signup" className="font-medium underline">
164+
Create an account
165+
</Link>
166+
</p>
169167
</div>
170168
<Image
171169
className="mt-10 object-cover md:hidden"

packages/wallet/frontend/src/pages/auth/signup.tsx

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@ import { cx } from 'class-variance-authority'
1717
import { signUpSchema } from '@wallet/shared'
1818
import { FEATURES_ENABLED, THEME } from '@/utils/constants'
1919
import { Checkbox } from '@/ui/forms/Checkbox'
20-
import { useRouter } from 'next/router'
2120

2221
const SignUpPage: NextPageWithLayout = () => {
2322
const [openDialog, closeDialog] = useDialog()
2423
const [isPasswordVisible, setPasswordVisible] = useState<boolean>(false)
2524
const [isRepeatPasswordVisible, setRepeatPasswordVisible] =
2625
useState<boolean>(false)
27-
const router = useRouter()
2826

2927
const signUpForm = useZodForm({
3028
schema: signUpSchema
@@ -36,9 +34,7 @@ const SignUpPage: NextPageWithLayout = () => {
3634
setRepeatPasswordVisible(!isRepeatPasswordVisible)
3735
}
3836
useEffect(() => {
39-
FEATURES_ENABLED ? router.push('/auth/login') : null
4037
signUpForm.setFocus('email')
41-
// eslint-disable-next-line react-hooks/exhaustive-deps
4238
}, [signUpForm])
4339

4440
return (
@@ -136,28 +132,11 @@ const SignUpPage: NextPageWithLayout = () => {
136132
{FEATURES_ENABLED ? (
137133
<div className="relative cursor-pointer">
138134
<Checkbox
135+
hidden
136+
checked
139137
{...signUpForm.register('acceptedCardTerms')}
140138
error={signUpForm.formState.errors.acceptedCardTerms?.message}
141-
label={
142-
<div>
143-
By clicking here, I confirm that I have read, understood,
144-
and agree with the&nbsp;
145-
<a
146-
className="underline"
147-
target="_blank"
148-
href="https://cdn.gatehub.net/docs/General_terms_for_Paywiser_x_GateHub-Mastercard_card_V1.pdf"
149-
rel="noreferrer"
150-
>
151-
Paywiser Terms and Conditions
152-
</a>
153-
&nbsp;for the use of the Paywiser MasterCard payment card,
154-
including the additional terms for card testing and
155-
limitations set out therein. I agree to not promote,
156-
advertise or post on any social media the Paywiser x GateHub
157-
MasterCard payment card without the prior written consent of
158-
the card issuer (Paywiser).
159-
</div>
160-
}
139+
label=""
161140
/>
162141
</div>
163142
) : null}

0 commit comments

Comments
 (0)