mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 21:03:03 -05:00
fix: refresh bug
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user