Skip to content

Commit

Permalink
reset
Browse files Browse the repository at this point in the history
  • Loading branch information
MegumiKim committed Oct 4, 2023
1 parent 3868f27 commit 51fde6c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 14 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/>
<title>Howdy | Log in</title>
<link rel="stylesheet" href="/dist/css/styles.css" />
<script src="./src/js/index.mjs" type="module"></script>
<script src="../src/js/index.mjs" type="module"></script>
<script
defer
src="/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"
Expand Down Expand Up @@ -65,7 +65,7 @@ <h4 class="mb-3 text-center">Log in</h4>
<hr class="my-4" />
<p class="w-100 text-center">
Don't have an account?
<a href="/./sign-up/index.html">sign up</a>
<a href="./sign-up/">sign up</a>
</p>
</form>
</div>
Expand Down
4 changes: 2 additions & 2 deletions posts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
content="Welcome to Howdy. Share your story and check out updates from your friends"
/>
<title>Howdy | Home</title>
<link rel="stylesheet" href="/dist/css/styles.css" />
<script src="../../src/js/index.mjs" type="module"></script>
<link rel="stylesheet" href="./../dist/css/styles.css" />
<script src="../src/js/index.mjs" type="module"></script>
</head>
<body>
<nav class="navbar navbar-expand-md bg-my-bg">
Expand Down
2 changes: 1 addition & 1 deletion profile/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Check and update your profile here" />
<title>Howdy | Profile</title>
<link rel="stylesheet" href="/dist/css/styles.css" />
<link rel="stylesheet" href="./../dist/css/styles.css" />
<script src="../../src/js/index.mjs" type="module"></script>

</head>
Expand Down
13 changes: 9 additions & 4 deletions sign-up/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@
content="Welcome to Howdy. Please provide long in details."
/>
<title>Howdy | Log in</title>
<link rel="stylesheet" href="/dist/css/styles.css" />
<script src="../src/js/index.mjs" type="module"></script>
<link rel="stylesheet" href="../dist/css/styles.css" />
<script src="./../src/js/index.mjs" type="module"></script>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4"
crossorigin="anonymous"
></script>
<!-- <script
src="/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"
defer
></script>
></script> -->
</head>
<body>
<div class="container">
Expand Down Expand Up @@ -101,7 +106,7 @@ <h4 class="mb-3 text-center">Sign up</h4>
></div>
<hr class="my-4" />
<p class="w-100 text-center">
Already have have an account? <a href="/./index.html">log in</a>
Already have have an account? <a href="/">log in</a>
</p>
</form>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/js/api/profiles/loginUser.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BASE_URL } from "../constants.mjs";
import { BASE_URL } from "./../constants.mjs";
import * as storages from "../../storage/index.mjs";

const registerURL = `${BASE_URL}/auth/login`;
Expand All @@ -22,7 +22,7 @@ export async function loginUser(options) {
if (accessToken) {
storages.locals.save("accessToken", accessToken);
storages.locals.save("otherDetails", otherDetails);
window.location.assign("/posts/");
window.location.assign("./posts/index.html");
} else {
const { errors } = json;
errors.forEach(({ message }) => {
Expand Down
8 changes: 5 additions & 3 deletions src/js/utils/forceLogIn.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { load } from "../storage/local.mjs";

/**Prevent user to visit the auth-restricted pages without access token */
export function forceLogIn() {
if (!load("accessToken")) {
location.href = "../../../index.html";
}
console.log("canceled");

// if (!load("accessToken")) {
// location.href = "../../../index.html";
// }
}

0 comments on commit 51fde6c

Please sign in to comment.