Skip to content

Commit

Permalink
added logs to auth and achievementListView
Browse files Browse the repository at this point in the history
  • Loading branch information
BatuevIO committed Oct 1, 2024
1 parent ad90bd3 commit 8e8e1a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/router/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const authHandler: NavigationGuard = async to => {
};
}

const { data, response } = profileStore.isUserLogged
const { data, response, error } = profileStore.isUserLogged
? await apiClient.POST(`/auth/${methodLink}/registration`, {
body: {
...to.query,
Expand All @@ -82,10 +82,8 @@ export const authHandler: NavigationGuard = async to => {
return { path: '/profile', replace: true };
} else {
if (response.status === 401) {
console.log('401 произошла', response);
//Это сработает или можно проще/правильнее?
const responseBody = await response.json();
const id_token = responseBody['id_token'];
console.log('401 произошла', response, data, error);
const id_token = data?.token;

if (typeof id_token !== 'string') {
return {
Expand Down
1 change: 1 addition & 0 deletions src/views/admin/achievement/AchievementListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ async function createAchievement(
new_description: string,
new_pic: File[] | undefined
) {
console.log(new_pic, new_pic?.length);
if (new_pic === undefined || new_pic.length !== 1) return;
const new_pic_str = new_pic.toString();
Expand Down

0 comments on commit 8e8e1a7

Please sign in to comment.