🐛 (refresh) refresh correct token

This commit is contained in:
Julien Calixte
2021-05-02 18:33:46 +02:00
parent 56432d81c8
commit d33fa18b9c
5 changed files with 64 additions and 37 deletions

View File

@@ -1,7 +1,7 @@
import { Octokit } from '@octokit/rest'
import { RepoBase } from '@/modules/repo/interfaces/RepoBase'
import { useAsyncState } from '@vueuse/core'
import { useGitHubLogin } from '@/hooks/useGitHubLogin.hook'
import { getOctokit } from '@/modules/repo/services/octo'
export const useRepos = () => {
const { username, accessToken } = useGitHubLogin()
@@ -10,9 +10,7 @@ export const useRepos = () => {
return []
}
const octokit = new Octokit({
auth: accessToken.value
})
const octokit = await getOctokit()
const repoList = await octokit.request('GET /search/repositories', {
q: `user:${username.value}`,