Skip to content

Commit 20677ef

Browse files
committed
Merge branch 'milestone-d4' of github.com:CS3219-AY2425S1/cs3219-ay2425s1-project-g15 into milestone-d4
2 parents 1304bb7 + a823d3f commit 20677ef

File tree

8 files changed

+29
-6
lines changed

8 files changed

+29
-6
lines changed

backend/user/.env.sample

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
DB_CLOUD_URI=
2+
DB_LOCAL_URI=
3+
PORT=
4+
5+
# Will use cloud MongoDB Atlas database
6+
ENV=
7+
8+
# Secret for creating JWT signature
9+
JWT_SECRET=

backend/user/controller/auth-controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import bcrypt from "bcrypt";
1+
import bcrypt from 'bcryptjs';
22
import jwt from "jsonwebtoken";
33
import { findUserByEmail as _findUserByEmail } from "../model/repository.js";
44
import { formatUserResponse } from "./user-controller.js";

backend/user/controller/user-controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import bcrypt from "bcrypt";
1+
import bcrypt from 'bcryptjs';
22
import { isValidObjectId } from "mongoose";
33
import {
44
createUser as _createUser,

backend/user/package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/user/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
"author": "",
1414
"license": "ISC",
1515
"devDependencies": {
16+
"@types/bcryptjs": "^2.4.6",
1617
"nodemon": "^3.1.4"
1718
},
1819
"dependencies": {
1920
"bcrypt": "^5.1.1",
21+
"bcryptjs": "^2.4.3",
2022
"cors": "^2.8.5",
2123
"dotenv": "^16.4.5",
2224
"express": "^4.19.2",

frontend/src/api/user.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const getBaseUserData = () => {
3030
};
3131
};
3232

33-
const NEXT_PUBLIC_USER_SERVICE = process.env.NEXT_PUBLIC_USER_SERVICE;
33+
const NEXT_PUBLIC_USER_SERVICE = process.env.NEXT_PUBLIC_USER_SERVICE || "https://user-service-598285527681.us-central1.run.app";
3434

3535
export const verifyToken = async (needsLogin: boolean) => {
3636
const token = getToken();

frontend/src/app/(auth)/(user)/login/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ import Navbar from "../../home/components/navbar/Navbar";
1212
const formSchema = z.object({
1313
email: z.string()
1414
.email("Invalid email"),
15-
password: z.string()
16-
.min(8, "Password must be at least 8 characters"),
15+
password: z.string(),
1716
});
1817

1918
const Login = () => {

frontend/src/app/(auth)/(user)/register/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const Register = () => {
8484
</FormItem>
8585
)}
8686
/>
87-
<Button type="submit" className="bg-yellow-500 hover:bg-yellow-300 px-4 py-2 my-2 rounded-md text-black">Login</Button>
87+
<Button type="submit" className="bg-yellow-500 hover:bg-yellow-300 px-4 py-2 my-2 rounded-md text-black">Register</Button>
8888
</form>
8989
</Form>
9090
</div>

0 commit comments

Comments
 (0)