Skip to content

Commit 0c2c1b3

Browse files
committed
Update gitlab-auth.js
1 parent 8d01457 commit 0c2c1b3

File tree

1 file changed

+14
-25
lines changed

1 file changed

+14
-25
lines changed

git/gitlab/gitlab-auth.js

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -78,35 +78,30 @@ window.onload = async () => {
7878

7979
window.addEventListener('message', (event) => {
8080

81-
// if redirected from git auth
82-
if (event.source.location.pathname === '/git/gitlab/oauth') {
83-
84-
// hide intro screen
85-
sidebar.classList.remove('intro');
81+
// hide intro screen
82+
sidebar.classList.remove('intro');
8683

87-
// if on safari, refresh header color
88-
if (isSafari) {
84+
// if on safari, refresh header color
85+
if (isSafari) {
8986

90-
document.querySelector('meta[name="theme-color"]').content = '#313744';
87+
document.querySelector('meta[name="theme-color"]').content = '#313744';
9188

92-
onNextFrame(() => {
89+
onNextFrame(() => {
9390

94-
document.querySelector('meta[name="theme-color"]').content = '#1a1c24';
91+
document.querySelector('meta[name="theme-color"]').content = '#1a1c24';
9592

96-
});
93+
});
9794

98-
}
95+
}
9996

100-
// start loading
101-
startLoading();
97+
// start loading
98+
startLoading();
10299

103-
const gitCode = event.data;
100+
const gitCode = event.data;
104101

105-
// get git token from Gitlab
106-
getGitlabToken(gitCode);
102+
// get git token from Gitlab
103+
getGitlabToken(gitCode);
107104

108-
}
109-
110105
})
111106

112107

@@ -171,9 +166,3 @@ async function getGitlabToken(gitCode) {
171166

172167
}
173168

174-
175-
176-
177-
178-
await axios.post('https://gitlab.com/oauth/token?client_id=&client_secret=&code=&&redirect_uri=https://codeit.codes/git/gitlab/oauth')
179-

0 commit comments

Comments
 (0)