chore: disable OTP/phone-validation at signup, fix next.config rewrite env bug, clean stale .next cache
This commit is contained in:
@@ -1,12 +1,16 @@
|
|||||||
import type { NextConfig } from "next";
|
import type { NextConfig } from "next";
|
||||||
|
|
||||||
|
// Use NEXT_PUBLIC_API_URL for local dev (http://localhost:8000),
|
||||||
|
// fall back to the Docker-internal service name for containerised deployments.
|
||||||
|
const API_BASE = process.env.NEXT_PUBLIC_API_URL || "http://backend:8000";
|
||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
output: "standalone",
|
output: "standalone",
|
||||||
async rewrites() {
|
async rewrites() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
source: "/api/:path*",
|
source: "/api/:path*",
|
||||||
destination: "http://backend:8000/api/:path*",
|
destination: `${API_BASE}/api/:path*`,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { Logo } from "@/components/Logo"
|
|||||||
export default function SignupPage() {
|
export default function SignupPage() {
|
||||||
const [step, setStep] = useState(1)
|
const [step, setStep] = useState(1)
|
||||||
const [showPassword, setShowPassword] = useState(false)
|
const [showPassword, setShowPassword] = useState(false)
|
||||||
const [showOTP, setShowOTP] = useState(false)
|
// const [showOTP, setShowOTP] = useState(false) // OTP flow disabled for now
|
||||||
const [email, setEmail] = useState("")
|
const [email, setEmail] = useState("")
|
||||||
const [password, setPassword] = useState("")
|
const [password, setPassword] = useState("")
|
||||||
const [isSubmitted, setIsSubmitted] = useState(false)
|
const [isSubmitted, setIsSubmitted] = useState(false)
|
||||||
@@ -20,7 +20,9 @@ export default function SignupPage() {
|
|||||||
const [phone, setPhone] = useState("")
|
const [phone, setPhone] = useState("")
|
||||||
const [termsAccepted, setTermsAccepted] = useState(false)
|
const [termsAccepted, setTermsAccepted] = useState(false)
|
||||||
|
|
||||||
const isStep1Valid = firstName.trim() !== "" && lastName.trim() !== "" && email.trim() !== "" && phone.length === 10 && termsAccepted
|
// Validation temporarily relaxed: phone length check and OTP verification removed for now.
|
||||||
|
// Original: firstName.trim() !== "" && lastName.trim() !== "" && email.trim() !== "" && phone.length === 10 && termsAccepted
|
||||||
|
const isStep1Valid = firstName.trim() !== "" && lastName.trim() !== "" && email.trim() !== "" && termsAccepted
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
@@ -154,12 +156,15 @@ export default function SignupPage() {
|
|||||||
placeholder="9876543210"
|
placeholder="9876543210"
|
||||||
className="flex-1 bg-background border border-border rounded-xl px-4 py-3 text-sm focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent transition-all"
|
className="flex-1 bg-background border border-border rounded-xl px-4 py-3 text-sm focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent transition-all"
|
||||||
/>
|
/>
|
||||||
|
{/* OTP flow temporarily disabled
|
||||||
{!showOTP && (
|
{!showOTP && (
|
||||||
<Button variant="secondary" onClick={() => setShowOTP(true)} className="h-[46px] rounded-xl font-bold">Send OTP</Button>
|
<Button variant="secondary" onClick={() => setShowOTP(true)} className="h-[46px] rounded-xl font-bold">Send OTP</Button>
|
||||||
)}
|
)}
|
||||||
|
*/}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* OTP verification section temporarily disabled
|
||||||
{showOTP && (
|
{showOTP && (
|
||||||
<div className="space-y-2 animate-in slide-in-from-top-2">
|
<div className="space-y-2 animate-in slide-in-from-top-2">
|
||||||
<label className="text-sm font-bold text-foreground flex justify-between">
|
<label className="text-sm font-bold text-foreground flex justify-between">
|
||||||
@@ -173,6 +178,7 @@ export default function SignupPage() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
*/}
|
||||||
|
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
@@ -194,7 +200,7 @@ export default function SignupPage() {
|
|||||||
<div className="flex items-start gap-2 pt-2">
|
<div className="flex items-start gap-2 pt-2">
|
||||||
<input type="checkbox" id="terms" checked={termsAccepted} onChange={(e) => setTermsAccepted(e.target.checked)} className="mt-1 w-4 h-4 rounded border-border bg-background focus:ring-primary focus:ring-2 cursor-pointer" />
|
<input type="checkbox" id="terms" checked={termsAccepted} onChange={(e) => setTermsAccepted(e.target.checked)} className="mt-1 w-4 h-4 rounded border-border bg-background focus:ring-primary focus:ring-2 cursor-pointer" />
|
||||||
<label htmlFor="terms" className="text-xs text-muted-foreground leading-relaxed">
|
<label htmlFor="terms" className="text-xs text-muted-foreground leading-relaxed">
|
||||||
I agree to the <Link href="/terms-and-conditions" className="text-primary hover:underline">Terms & Conditions</Link> and <Link href="/privacy-policy" className="text-primary hover:underline">Privacy Policy</Link>.
|
I agree to the <Link href="/terms-and-conditions" className="text-primary hover:underline">Terms & Conditions</Link> and <Link href="/privacy-policy" className="text-primary hover:underline">Privacy Policy</Link>.
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user