Co-authored-by: TakahashiNg <83152264+TakahashiNguyen@users.noreply.github.com> Reviewed-on: #35
This commit was merged in pull request #35.
This commit is contained in:
@@ -22,9 +22,16 @@ jobs:
|
|||||||
id-token: write
|
id-token: write
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: gerlero/apt-install@v1
|
- name: Install dependencies with Proxy
|
||||||
with:
|
env:
|
||||||
packages: docker.io zip
|
http_proxy: "http://host.docker.internal:3142"
|
||||||
|
https_proxy: "http://host.docker.internal:3142"
|
||||||
|
run: |
|
||||||
|
# Kiểm tra proxy có hoạt động không
|
||||||
|
echo "Acquire::http::Proxy \"$http_proxy\";" > /etc/apt/apt.conf.d/80proxy
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y --no-install-recommends --no-install-suggests \
|
||||||
|
docker-cli zip
|
||||||
|
|
||||||
- name: Setup SSH Key
|
- name: Setup SSH Key
|
||||||
run: |
|
run: |
|
||||||
@@ -43,7 +50,19 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
run_install: false
|
run_install: false
|
||||||
cache: true
|
|
||||||
|
- name: Get pnpm store directory
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Setup pnpm cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ${{ env.STORE_PATH }}
|
||||||
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-pnpm-store-
|
||||||
|
|
||||||
- name: Update dependencies
|
- name: Update dependencies
|
||||||
run: pnpm update
|
run: pnpm update
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { SHOP_INFO } from "@/lib/constants";
|
|||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { FormEvent, useState } from "react";
|
import { SubmitEvent, useState } from "react";
|
||||||
|
|
||||||
// Static OTP for demo (in production, this would be sent via SMS)
|
// Static OTP for demo (in production, this would be sent via SMS)
|
||||||
const DEMO_OTP = "123456";
|
const DEMO_OTP = "123456";
|
||||||
@@ -28,7 +28,7 @@ export default function RegisterPage() {
|
|||||||
return phoneRegex.test(phoneNumber);
|
return phoneRegex.test(phoneNumber);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handlePhoneSubmit = (e: FormEvent) => {
|
const handlePhoneSubmit = (e: SubmitEvent<HTMLFormElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
if (!phone.trim()) {
|
if (!phone.trim()) {
|
||||||
@@ -44,12 +44,14 @@ export default function RegisterPage() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Move to OTP step
|
// Move to OTP step
|
||||||
setStep("otp");
|
setStep("otp");
|
||||||
setErrors({ phone: "", otp: "" });
|
setErrors({ phone: "", otp: "" });
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleOtpSubmit = (e: FormEvent) => {
|
const handleOtpSubmit = (e: SubmitEvent<HTMLFormElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
if (!otp.trim()) {
|
if (!otp.trim()) {
|
||||||
|
|||||||
@@ -19,6 +19,18 @@ const nextConfig: NextConfig = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
async rewrites() {
|
||||||
|
const rewrites = [];
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV !== "production") {
|
||||||
|
rewrites.push({
|
||||||
|
source: "/api/:path*",
|
||||||
|
destination: "http://host.docker.internal:32080/api/:path*",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return rewrites;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
|
|||||||
Reference in New Issue
Block a user