fix: refresh bug

This commit is contained in:
thomas
2024-03-30 13:10:03 +01:00
parent 722ccc028e
commit 9b4ee0e5bf
2 changed files with 5 additions and 9 deletions

View File

@@ -53,7 +53,11 @@
async function fetchStats() {
try {
const response = await fetch(`https://api.github.com/repos/tomalaforge/angular-challenges`);
const response = await fetch(`https://api.github.com/repos/tomalaforge/angular-challenges`, {
headers: {
Authorization: `token ${$token}`
}
});
if (!response.ok) {
if (response.status === 401) {
const refresh = await fetch('/auth/refresh');