Skip to content

Commit 7f46bdc

Browse files
committed
Changed jwt token expiry to 2hours and added minimal css to login page
1 parent 94ae2a6 commit 7f46bdc

File tree

6 files changed

+25
-47
lines changed

6 files changed

+25
-47
lines changed

backend/user-service/src/auth/auth.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class AuthService {
2424
console.log("PAYLOAD")
2525
console.log(payload);
2626
const tokenData = { sub: payload['sub'], email: payload['email'], name: payload['name'], picture: payload['picture'] }
27-
const accessToken = await this.jwtService.signAsync(tokenData, { expiresIn: 60 });
27+
const accessToken = await this.jwtService.signAsync(tokenData, { expiresIn: "2h" });
2828
console.log("THIS IS THE TOKEN ", accessToken);
2929
return {jwtToken: accessToken};
3030
}

frontend/src/App.css

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,5 @@
11
.App {
22
text-align: center;
3-
}
4-
5-
.App-logo {
6-
height: 40vmin;
7-
pointer-events: none;
8-
}
9-
10-
@media (prefers-reduced-motion: no-preference) {
11-
.App-logo {
12-
animation: App-logo-spin infinite 20s linear;
13-
}
14-
}
15-
16-
.App-header {
17-
background-color: #282c34;
18-
min-height: 100vh;
19-
display: flex;
20-
flex-direction: column;
21-
align-items: center;
22-
justify-content: center;
23-
font-size: calc(10px + 2vmin);
3+
background-color: black;
244
color: white;
255
}
26-
27-
.App-link {
28-
color: #61dafb;
29-
}
30-
31-
@keyframes App-logo-spin {
32-
from {
33-
transform: rotate(0deg);
34-
}
35-
to {
36-
transform: rotate(360deg);
37-
}
38-
}

frontend/src/App.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ import { UserContextProvider } from './UserContextProvider';
99
function App() {
1010
return (
1111
<UserContextProvider>
12-
<Routes>
13-
<Route path='/' element={<LoginPage />} />
14-
<Route path='/login' element={<LoginPage />} />
15-
<Route path='/profile' element={<ProfilePage />} />
16-
</Routes>
12+
<div class="App h-screen">
13+
<Routes>
14+
<Route path='/' element={<LoginPage />} />
15+
<Route path='/login' element={<LoginPage />} />
16+
<Route path='/profile' element={<ProfilePage />} />
17+
</Routes>
18+
</div>
1719
</UserContextProvider>
1820
);
1921
}
443 KB
Loading

frontend/src/css/LoginPage.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
.login {
3+
color: white;
4+
background-image: url('../assets/loginPageImage.png');
5+
background-size: cover;
6+
}
7+

frontend/src/pages/LoginPage.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { UserContext } from "../UserContextProvider";
33
import { useNavigate } from "react-router-dom";
44
import { GoogleLogin } from "@react-oauth/google";
55
import axios from 'axios';
6-
6+
import '../css/LoginPage.css';
77

88
export default function LoginPage() {
99
const { loggedIn, setToken } = useContext(UserContext);
@@ -29,12 +29,14 @@ export default function LoginPage() {
2929
};
3030

3131
return (
32-
<div>
33-
<h1>Welcome to PeerPrep</h1>
34-
<GoogleLogin
35-
onSuccess={onSuccess}
36-
// onError={onError}
37-
/>
32+
<div class="login flex flex-col items-center justify-center h-screen">
33+
<div class="text-center">
34+
<h1>Welcome to PeerPrep</h1>
35+
<GoogleLogin
36+
onSuccess={onSuccess}
37+
// onError={onError}
38+
/>
39+
</div>
3840
</div>
3941
)
4042
};

0 commit comments

Comments
 (0)