Skip to content

Commit

Permalink
Merge pull request #1084 from traPtitech/fix#1083
Browse files Browse the repository at this point in the history
Fix#1083
  • Loading branch information
kaitoyama committed Aug 20, 2023
2 parents 513ebe8 + 2e951e8 commit 452e021
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
14 changes: 0 additions & 14 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"dependencies": {
"@traptitech/traq": "^3.4.5-1",
"axios": "^0.21.2",
"base64url": "^3.0.1",
"bulma": "^0.9.1",
"caniuse-lite": "^1.0.30001239",
"js-sha256": "^0.9.0",
Expand Down
13 changes: 11 additions & 2 deletions client/src/bin/traqAuth.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import axios from 'axios'
import sha256 from 'js-sha256'
import base64url from 'base64url'

const baseUrl = 'https://q.trap.jp/api/v3/oauth2'

Expand All @@ -24,7 +23,17 @@ const randomString = len => {
}

const getCodeChallenge = codeVerifier => {
return base64url(sha256.arrayBuffer(codeVerifier))
const sha256Result = sha256(codeVerifier)
const bytes = new Uint8Array(sha256Result.length / 2)
for (let i = 0; i < sha256Result.length; i += 2) {
bytes[i / 2] = parseInt(sha256Result.substring(i, i + 2), 16)
}
const base64 = btoa(String.fromCharCode(...bytes))
const base64url = base64
.replace(/\+/g, '-')
.replace(/\//g, '_')
.replace(/=/g, '')
return base64url
}

export function sendCodeRequest() {
Expand Down
8 changes: 7 additions & 1 deletion client/src/components/Utils/SideMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default {
methods: {
createQuestionnaire() {
this.$emit('close-side-menu')
router.push('/questionnaires/new')
router.push('/questionnaires/new').catch(err => console.error(err))
}
}
}
Expand All @@ -59,24 +59,29 @@ export default {
min-width: fit-content;
background-color: $base-lightbrown;
}
.menu-list {
hr {
// border-style: outset;
// border-top-color: $base-brown;
border: $base-darkbrown solid 2px;
margin: 0.3rem 0;
}
.button {
margin: 0.5rem;
}
}
.menu-list a {
position: relative;
display: inline-block;
text-decoration: none;
&:hover {
background-color: inherit;
}
&::after {
position: absolute;
bottom: 3.5px;
Expand All @@ -90,6 +95,7 @@ export default {
transition: transform 0.3s;
}
}
.menu-list :hover::after {
transform-origin: left top;
transform: scale(1, 1);
Expand Down
2 changes: 1 addition & 1 deletion docker/dev/.air.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ root = "."
tmp_dir = "tmp"

[build]
cmd = "go build -o ./tmp/main ."
cmd = "go build -buildvcs=false -o ./tmp/main ."
bin = "./tmp/main"
include_ext = ["go", "tpl", "tmpl", "html"]
exclude_dir = ["assets", "tmp", "vendor", "node_modules","client","tuning",".github"]
Expand Down

0 comments on commit 452e021

Please sign in to comment.