Skip to content

Commit a6434e6

Browse files
Fix/redirection (#633)
* fix redirection to home page instead of dashboard site on login from dashboard * changed link component to button
1 parent c71f05a commit a6434e6

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

index.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,10 @@
3434
</div>
3535
</div>
3636
<div class="sign-in-btn">
37-
<a
38-
href="https://github.com/login/oauth/authorize?client_id=23c78f66ab7964e5ef97"
39-
>Sign In <span>With GitHub</span>
37+
<button onclick="goToAuthPage()">
38+
Sign In <span>With GitHub</span>
4039
<img src="images/github.png" class="user-avatar" />
41-
</a>
40+
</button>
4241
</div>
4342
<div class="user-info">
4443
<span id="user-name"></span>

style.css

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,23 @@ img {
8181
order: 3;
8282
}
8383

84-
.sign-in-btn a {
84+
.sign-in-btn button {
8585
position: absolute;
8686
right: 10px;
8787
margin: 10px;
8888
height: 30px;
89+
width: fit-content;
8990
padding: 5px;
9091
background-color: var(--blue-color);
9192
color: var(--white-color);
9293
cursor: pointer;
9394
border: 2px solid var(--white-color);
9495
border-radius: 6px;
9596
text-decoration: none;
97+
font-size: 16px;
9698
}
9799

98-
.sign-in-btn a img {
100+
.sign-in-btn button img {
99101
height: 15px;
100102
width: 15px;
101103
position: relative;
@@ -465,7 +467,7 @@ footer {
465467
justify-content: space-between;
466468
}
467469

468-
.sign-in-btn a {
470+
.sign-in-btn button {
469471
position: static;
470472
}
471473

utils.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
function goToAuthPage() {
2+
const authUrl = `https://github.com/login/oauth/authorize?client_id=23c78f66ab7964e5ef97&}&state=${window.location.href}`;
3+
4+
window.open(authUrl, '_self');
5+
}
6+
17
async function getSelfUser(endpoint = '/users/self') {
28
try {
39
const res = await fetch(`${API_BASE_URL}${endpoint}`, {

0 commit comments

Comments
 (0)