From f64b2b42f3e40970753ce738aae65b6ab24a82fb Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Wed, 27 Sep 2023 12:54:34 +0200 Subject: [PATCH 01/20] Update package.json --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 3b0cde2..861f08a 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "@recogito/annotorious-openseadragon": "^2.7.6", "@vue/vue3-jest": "^29.2.1", "core-js": "^3.6.5", - "dotenv": "^16.3.1", "js-base64": "^3.7.5", "octokit": "^2.0.14", "openseadragon": "^3.0.0", From 75ea7329780baba68004c51838d11966b6756025 Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:00:28 +0200 Subject: [PATCH 02/20] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2f08c35..065b852 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM node:latest as builder WORKDIR /usr/app COPY . . -#RUN echo "VUE_APP_CLIENT_ID=$CLIENT_ID" >.env.development.local +RUN echo "VUE_APP_CLIENT_ID=$CLIENT_ID" >.env.development.local RUN npm i --legacy-peer-deps && npm run build From 54188d0ced59efbdbe6308c840b7e64704bf70ae Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:06:13 +0200 Subject: [PATCH 03/20] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 065b852..a756d94 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM node:latest as builder WORKDIR /usr/app COPY . . RUN echo "VUE_APP_CLIENT_ID=$CLIENT_ID" >.env.development.local -RUN npm i --legacy-peer-deps && npm run build +RUN npm install --legacy-peer-deps --force && npm run build FROM nginx:alpine From 0bd260c10728282c0c59b2677af1386479eecf90 Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:10:04 +0200 Subject: [PATCH 04/20] Update index.js --- src/store/index.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 2ad9d98..1de3665 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -493,12 +493,9 @@ export default createStore({ // } const clientId = CLIENT_ID; -<<<<<<< HEAD const redirectUri = CALL_BACK; const clientSecret = CLIENT_SECRET; -======= const redirectUri = 'https://cartographer-app.zenmem.de/callback'; ->>>>>>> 03bc754534ee4a7789844d1eeaa6d7f095d65f0d const scope = 'user'; From 03cb01bc92cd84fe9ed75effe91e4b66dab55386 Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:13:00 +0200 Subject: [PATCH 05/20] Update index.js --- src/store/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index 1de3665..7db3dd3 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -495,7 +495,6 @@ export default createStore({ const clientId = CLIENT_ID; const redirectUri = CALL_BACK; const clientSecret = CLIENT_SECRET; - const redirectUri = 'https://cartographer-app.zenmem.de/callback'; const scope = 'user'; From 30c84405a0fcfefdd1472cfc52c303a186033c0e Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:17:06 +0200 Subject: [PATCH 06/20] Update .env --- .env | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.env b/.env index d22c9ef..0d60825 100644 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ -CLIENT_ID=dc330d7fe9904f7dfcd8 -CLIENT_SECRET=838495f0bc343f514832b019f4610a5ecf32922b +CLIENT_ID=2cfd2feb1cc7af2ff375 +CLIENT_SECRET=4dc28d9cc0c375bf744a004825aa7e09bf2c5964 VUE_APP_CLIENT_ID=$CLIENT_ID VUE_APP_CLIENT_SECRET=$CLIENT_SECRET CALL_BACK=http://localhost:8080/callback -VUE_APP_CALL_BACK=$CALL_BACK \ No newline at end of file +VUE_APP_CALL_BACK=$CALL_BACK From f191dfaf689cbee7e653ed98be053f8b8ba7257f Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:31:23 +0200 Subject: [PATCH 07/20] Update Dockerfile --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index a756d94..243d250 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,8 @@ FROM node:latest as builder WORKDIR /usr/app COPY . . RUN echo "VUE_APP_CLIENT_ID=$CLIENT_ID" >.env.development.local +RUN echo "VUE_APP_CLIENT_SECRET=$CLIENT_SECRET" >.env.development.local +RUN echo "VUE_APP_CALL_BACK=$CALL_BACK" >.env.development.local RUN npm install --legacy-peer-deps --force && npm run build From 9456efceac570ade2ab83801dfa3aabc159455aa Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:35:29 +0200 Subject: [PATCH 08/20] Update index.js --- src/store/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/store/index.js b/src/store/index.js index 7db3dd3..5010aca 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -494,6 +494,7 @@ export default createStore({ const clientId = CLIENT_ID; const redirectUri = CALL_BACK; + console.log("this is CLIENT ID " + clientId) const clientSecret = CLIENT_SECRET; const scope = 'user'; From 4825b179b9a3b5ae5da8eb40fc6f01ddd0c2abf7 Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:40:00 +0200 Subject: [PATCH 09/20] Update index.js --- src/store/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/store/index.js b/src/store/index.js index 5010aca..6309489 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -8,6 +8,7 @@ import { Octokit } from '@octokit/rest' //import axios from 'axios'; //import qs from 'query-string'; import CLIENT_ID from './client_id'; +console.log("this is CLIENT ID " + CLIENT_ID) import CALL_BACK from './call_back'; import CLIENT_SECRET from './client_secret'; import { Base64 } from 'js-base64'; From 9a081fbc9a95c10ffa626f831b5d865153e7206d Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:54:12 +0200 Subject: [PATCH 10/20] Update index.js --- src/store/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index 6309489..745e8c1 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -8,9 +8,10 @@ import { Octokit } from '@octokit/rest' //import axios from 'axios'; //import qs from 'query-string'; import CLIENT_ID from './client_id'; -console.log("this is CLIENT ID " + CLIENT_ID) import CALL_BACK from './call_back'; import CLIENT_SECRET from './client_secret'; +console.log("this is CLIENT SECRET " + CLIENT_SECRET) + import { Base64 } from 'js-base64'; const parser = new DOMParser() const serializer = new XMLSerializer() From cecc9c72ca769b70e9e0bba494f9ca61efdcad65 Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Wed, 27 Sep 2023 14:00:07 +0200 Subject: [PATCH 11/20] Update .env --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 0d60825..1b8dbd5 100644 --- a/.env +++ b/.env @@ -2,5 +2,5 @@ CLIENT_ID=2cfd2feb1cc7af2ff375 CLIENT_SECRET=4dc28d9cc0c375bf744a004825aa7e09bf2c5964 VUE_APP_CLIENT_ID=$CLIENT_ID VUE_APP_CLIENT_SECRET=$CLIENT_SECRET -CALL_BACK=http://localhost:8080/callback +CALL_BACK=http:https://cartographer-app.zenmem.de/callback VUE_APP_CALL_BACK=$CALL_BACK From 5d3a6638abcabd4310ac313bc238efbf5640d392 Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Wed, 27 Sep 2023 14:47:07 +0200 Subject: [PATCH 12/20] Update index.js --- src/store/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index 745e8c1..0e9c205 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -10,7 +10,7 @@ import { Octokit } from '@octokit/rest' import CLIENT_ID from './client_id'; import CALL_BACK from './call_back'; import CLIENT_SECRET from './client_secret'; -console.log("this is CLIENT SECRET " + CLIENT_SECRET) +console.log("this is URL " + CALL_BACK) import { Base64 } from 'js-base64'; const parser = new DOMParser() From a1d0b72f0aa66e6c8a0ee1ecb32cdf86efd881a6 Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Wed, 27 Sep 2023 14:53:23 +0200 Subject: [PATCH 13/20] Update .env --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 1b8dbd5..672269f 100644 --- a/.env +++ b/.env @@ -2,5 +2,5 @@ CLIENT_ID=2cfd2feb1cc7af2ff375 CLIENT_SECRET=4dc28d9cc0c375bf744a004825aa7e09bf2c5964 VUE_APP_CLIENT_ID=$CLIENT_ID VUE_APP_CLIENT_SECRET=$CLIENT_SECRET -CALL_BACK=http:https://cartographer-app.zenmem.de/callback +CALL_BACK=https://cartographer-app.zenmem.de/callback VUE_APP_CALL_BACK=$CALL_BACK From 6036e2bd8aea602bd62ac145ff97356d34c53674 Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Wed, 27 Sep 2023 14:57:56 +0200 Subject: [PATCH 14/20] Update index.js --- src/store/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 0e9c205..2a744fd 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -10,7 +10,10 @@ import { Octokit } from '@octokit/rest' import CLIENT_ID from './client_id'; import CALL_BACK from './call_back'; import CLIENT_SECRET from './client_secret'; -console.log("this is URL " + CALL_BACK) +console.log("this is URL " + url) +console.log("this is CLIENT_ID " + client_id) +console.log("this is CLIENT_SECRET " + client_secret) + import { Base64 } from 'js-base64'; const parser = new DOMParser() @@ -496,7 +499,6 @@ export default createStore({ const clientId = CLIENT_ID; const redirectUri = CALL_BACK; - console.log("this is CLIENT ID " + clientId) const clientSecret = CLIENT_SECRET; const scope = 'user'; @@ -507,7 +509,6 @@ export default createStore({ redirect_uri: redirectUri, scope, }); - console.log("this is the client id " + clientId) window.location.href = `https://github.com/login/oauth/authorize?${query}`; }, From 74699771a21734ab893ab3579a96d5e72120cceb Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Wed, 27 Sep 2023 15:01:52 +0200 Subject: [PATCH 15/20] Update index.js --- src/store/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 2a744fd..9adf78f 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -10,9 +10,9 @@ import { Octokit } from '@octokit/rest' import CLIENT_ID from './client_id'; import CALL_BACK from './call_back'; import CLIENT_SECRET from './client_secret'; -console.log("this is URL " + url) -console.log("this is CLIENT_ID " + client_id) -console.log("this is CLIENT_SECRET " + client_secret) +console.log("this is URL " + CALL_BACK) +console.log("this is CLIENT_ID " + CLIENT_ID) +console.log("this is CLIENT_SECRET " + CLIENT_SECRET) import { Base64 } from 'js-base64'; From ed65989483144acc30f2835b9a9f00fc48d93893 Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Wed, 27 Sep 2023 16:20:07 +0200 Subject: [PATCH 16/20] Update .env --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 672269f..ed91e4c 100644 --- a/.env +++ b/.env @@ -2,5 +2,5 @@ CLIENT_ID=2cfd2feb1cc7af2ff375 CLIENT_SECRET=4dc28d9cc0c375bf744a004825aa7e09bf2c5964 VUE_APP_CLIENT_ID=$CLIENT_ID VUE_APP_CLIENT_SECRET=$CLIENT_SECRET -CALL_BACK=https://cartographer-app.zenmem.de/callback +CALL_BACK=https://cartographer-app.zenmem.de VUE_APP_CALL_BACK=$CALL_BACK From 6be45d37c53fefa0734980110c74f1cf1ab8f8dd Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Thu, 28 Sep 2023 10:42:59 +0200 Subject: [PATCH 17/20] Update index.js --- src/store/index.js | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 9adf78f..2c28976 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -418,8 +418,23 @@ export default createStore({ commit('TOGGLE_LOADGIT_MODAL') }, authenticate ({commit, state}, {code}){ + + console.log("this is the authenticate function ") + const clientId = CLIENT_ID; + const redirectUri = CALL_BACK; + const clientSecret = CLIENT_SECRET; + const scope = 'user'; + - const url = `auth?code=${code}` + const query = qs.stringify({ + client_id: clientId, + client_secret: clientSecret, + redirect_uri: redirectUri, + scope, + }); + + const url = `https://github.com/login/oauth/authorize?auth?code=${code}&${query}` + console.log(url) fetch(url).then(resp => { if (resp.ok) { @@ -433,11 +448,11 @@ export default createStore({ } else { - console.error('authentication failed', data) + console.error('authentication failed 1', data) } }) } else { - console.error('authentication failed', resp.statusText) + console.error('authentication failed 2', resp.statusText) } }) @@ -509,7 +524,8 @@ export default createStore({ redirect_uri: redirectUri, scope, }); - window.location.href = `https://github.com/login/oauth/authorize?${query}`; + window.location.href = `https://github.com/login/oauth/authorize?${query}`; + }, // Call the callback function From 99c45ab286c08b767ac0f0f96401a6e9f013f402 Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Thu, 28 Sep 2023 10:49:33 +0200 Subject: [PATCH 18/20] Update index.js --- src/store/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 2c28976..1429526 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -10,9 +10,7 @@ import { Octokit } from '@octokit/rest' import CLIENT_ID from './client_id'; import CALL_BACK from './call_back'; import CLIENT_SECRET from './client_secret'; -console.log("this is URL " + CALL_BACK) -console.log("this is CLIENT_ID " + CLIENT_ID) -console.log("this is CLIENT_SECRET " + CLIENT_SECRET) + import { Base64 } from 'js-base64'; From aabfd96b5b290559a6621309be6e3826e8658021 Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Thu, 28 Sep 2023 10:54:43 +0200 Subject: [PATCH 19/20] Update index.js --- src/store/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index 1429526..bf8db5f 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -432,14 +432,15 @@ export default createStore({ }); const url = `https://github.com/login/oauth/authorize?auth?code=${code}&${query}` - console.log(url) fetch(url).then(resp => { if (resp.ok) { + console.log("OK") resp.json().then(data => { const accessToken = data.access_token if (accessToken) { state.logedin = true + const userId = data.id; commit('SET_ACCESS_TOKEN', { auth: accessToken}) commit('SET_OWNER') From b7ed6d69aec0dbf8d03af23756e3d636da968a92 Mon Sep 17 00:00:00 2001 From: Hizkiel Alemayehu <44091398+hizclick@users.noreply.github.com> Date: Thu, 28 Sep 2023 10:58:50 +0200 Subject: [PATCH 20/20] Update index.js --- src/store/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index bf8db5f..b00e4f4 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -434,8 +434,8 @@ export default createStore({ const url = `https://github.com/login/oauth/authorize?auth?code=${code}&${query}` fetch(url).then(resp => { + console.log(resp.ok) if (resp.ok) { - console.log("OK") resp.json().then(data => { const accessToken = data.access_token if (accessToken) {