Skip to content

Commit

Permalink
feat: добавлена авторизация в приложении, вернул base-layout
Browse files Browse the repository at this point in the history
  • Loading branch information
upikoth committed Jun 6, 2024
1 parent ae9b496 commit eb646f8
Show file tree
Hide file tree
Showing 10 changed files with 545 additions and 43 deletions.
89 changes: 89 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@capacitor/ios": "^6.0.0",
"@quasar/extras": "^1.16.11",
"@sentry/vue": "^8.7.0",
"@vueuse/core": "^10.10.0",
"pinia": "^2.1.7",
"quasar": "^2.16.4",
"vue": "^3.4.27",
Expand Down
9 changes: 6 additions & 3 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import { MILLISECONDS_IN_MINUTE } from '@/constants'
import type { ErrorResponse } from '@/generated/starter'
import {
HealthApi,
RegistrationApi
RegistrationsApi,
SessionsApi
} from '@/generated/starter'

import { useSessionStore } from '@/stores'
Expand All @@ -30,7 +31,7 @@ export default function useApi() {
})

axiosInstance.interceptors.request.use(
(req) => {
async (req) => {
if (sessionStore.isAuthorized) {
req.headers['Authorization-Token'] = sessionStore.token
}
Expand All @@ -52,11 +53,13 @@ export default function useApi() {
)

const health = new HealthApi(undefined, undefined, axiosInstance)
const registrations = new RegistrationApi(undefined, undefined, axiosInstance)
const registrations = new RegistrationsApi(undefined, undefined, axiosInstance)
const sessions = new SessionsApi(undefined, undefined, axiosInstance)

return {
health,
registrations,
sessions,
getApiErrorOrMessage,
checkIsApiErrorField
}
Expand Down
Loading

0 comments on commit eb646f8

Please sign in to comment.