update
@ -43,3 +43,10 @@ pnpm run preview
|
||||
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
|
||||
|
||||
View Primevue out the [documentation](https://primevue.org/nuxt) for more information.
|
||||
|
||||
|
||||
## ikon és splash képernyő
|
||||
Az assets/ mappát megtarthatod - ha később módosítani akarod az icon-t vagy splash-t, csak cseréld le az assets/icon.png vagy assets/splash.png fájlt, és futtasd újra:
|
||||
|
||||
pnpm capacitor-assets generate --iconBackgroundColor '#262626' --splashBackgroundColor '#262626'
|
||||
pnpm cap sync
|
||||
|
||||
BIN
assets/icon.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
assets/splash-dark.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
assets/splash.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
@ -1,37 +1,14 @@
|
||||
const AUTH_KEY = '_auth'
|
||||
|
||||
// Platform ellenőrzés - csak kliens oldalon
|
||||
const isNative = (): boolean => {
|
||||
if (typeof window === 'undefined') return false
|
||||
try {
|
||||
const { Capacitor } = require('@capacitor/core')
|
||||
return Capacitor.isNativePlatform()
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
export const useAuthToken = () => {
|
||||
const token = ref<string | null>(null)
|
||||
const isLoaded = ref(false)
|
||||
|
||||
// Token betöltése
|
||||
// Token betöltése - LocalStorage (működik web + native)
|
||||
const loadToken = async (): Promise<string | null> => {
|
||||
// SSR esetén ne csináljunk semmit
|
||||
if (typeof window === 'undefined') {
|
||||
return null
|
||||
}
|
||||
if (typeof window === 'undefined') return null
|
||||
|
||||
if (isNative()) {
|
||||
// Natív app: Preferences használata
|
||||
const { Preferences } = await import('@capacitor/preferences')
|
||||
const { value } = await Preferences.get({ key: AUTH_KEY })
|
||||
token.value = value
|
||||
} else {
|
||||
// Web: Cookie használata
|
||||
const cookie = useCookie(AUTH_KEY)
|
||||
token.value = cookie.value || null
|
||||
}
|
||||
token.value = localStorage.getItem(AUTH_KEY)
|
||||
isLoaded.value = true
|
||||
return token.value
|
||||
}
|
||||
@ -41,13 +18,7 @@ export const useAuthToken = () => {
|
||||
if (typeof window === 'undefined') return
|
||||
|
||||
token.value = newToken
|
||||
if (isNative()) {
|
||||
const { Preferences } = await import('@capacitor/preferences')
|
||||
await Preferences.set({ key: AUTH_KEY, value: newToken })
|
||||
} else {
|
||||
const cookie = useCookie(AUTH_KEY, { maxAge: 60 * 60 * 24 * 365 }) // 1 év
|
||||
cookie.value = newToken
|
||||
}
|
||||
localStorage.setItem(AUTH_KEY, newToken)
|
||||
}
|
||||
|
||||
// Token törlése (kijelentkezés)
|
||||
@ -55,13 +26,7 @@ export const useAuthToken = () => {
|
||||
if (typeof window === 'undefined') return
|
||||
|
||||
token.value = null
|
||||
if (isNative()) {
|
||||
const { Preferences } = await import('@capacitor/preferences')
|
||||
await Preferences.remove({ key: AUTH_KEY })
|
||||
} else {
|
||||
const cookie = useCookie(AUTH_KEY)
|
||||
cookie.value = null
|
||||
}
|
||||
localStorage.removeItem(AUTH_KEY)
|
||||
}
|
||||
|
||||
// Getter a token értékhez
|
||||
|
||||
BIN
icons/icon-128.webp
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
icons/icon-192.webp
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
icons/icon-256.webp
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
icons/icon-48.webp
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
icons/icon-512.webp
Normal file
|
After Width: | Height: | Size: 73 KiB |
BIN
icons/icon-72.webp
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
icons/icon-96.webp
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
@ -33,6 +33,7 @@
|
||||
"@capacitor/android": "^8.0.0",
|
||||
"@capacitor/app": "^8.0.0",
|
||||
"@capacitor/core": "^8.0.0",
|
||||
"@capacitor/device": "^8.0.0",
|
||||
"@capacitor/haptics": "^8.0.0",
|
||||
"@capacitor/ios": "^8.0.0",
|
||||
"@capacitor/preferences": "^8.0.0",
|
||||
|
||||
@ -17,6 +17,9 @@ importers:
|
||||
'@capacitor/core':
|
||||
specifier: ^8.0.0
|
||||
version: 8.0.0
|
||||
'@capacitor/device':
|
||||
specifier: ^8.0.0
|
||||
version: 8.0.0(@capacitor/core@8.0.0)
|
||||
'@capacitor/haptics':
|
||||
specifier: ^8.0.0
|
||||
version: 8.0.0(@capacitor/core@8.0.0)
|
||||
@ -674,6 +677,11 @@ packages:
|
||||
'@capacitor/core@8.0.0':
|
||||
resolution: {integrity: sha512-250HTVd/W/KdMygoqaedisvNbHbpbQTN2Hy/8ZYGm1nAqE0Fx7sGss4l0nDg33STxEdDhtVRoL2fIaaiukKseA==}
|
||||
|
||||
'@capacitor/device@8.0.0':
|
||||
resolution: {integrity: sha512-qFmlTDnAvUwIg93YUF3u3ovqpDFqUl2RFkf2dVIF8Py7vTA+GjQIHQWITcBKfeUENoVXPNn04t5nxg5mAkjNEA==}
|
||||
peerDependencies:
|
||||
'@capacitor/core': '>=8.0.0'
|
||||
|
||||
'@capacitor/haptics@8.0.0':
|
||||
resolution: {integrity: sha512-DY1IUOjke1T4ITl7mFHQIKCaJJyHYAYRYHG9bVApU7PDOZiMVGMp48Yjzdqjya+wv/AHS5mDabSTUmhJ5uDvBA==}
|
||||
peerDependencies:
|
||||
@ -6640,6 +6648,10 @@ snapshots:
|
||||
dependencies:
|
||||
tslib: 2.8.1
|
||||
|
||||
'@capacitor/device@8.0.0(@capacitor/core@8.0.0)':
|
||||
dependencies:
|
||||
'@capacitor/core': 8.0.0
|
||||
|
||||
'@capacitor/haptics@8.0.0(@capacitor/core@8.0.0)':
|
||||
dependencies:
|
||||
'@capacitor/core': 8.0.0
|
||||
|
||||
47
public/manifest.webmanifest
Normal file
@ -0,0 +1,47 @@
|
||||
{
|
||||
"background_color": "#262626",
|
||||
"icons": [
|
||||
{
|
||||
"src": "../icons/icon-48.webp",
|
||||
"type": "image/png",
|
||||
"sizes": "48x48",
|
||||
"purpose": "any maskable"
|
||||
},
|
||||
{
|
||||
"src": "../icons/icon-72.webp",
|
||||
"type": "image/png",
|
||||
"sizes": "72x72",
|
||||
"purpose": "any maskable"
|
||||
},
|
||||
{
|
||||
"src": "../icons/icon-96.webp",
|
||||
"type": "image/png",
|
||||
"sizes": "96x96",
|
||||
"purpose": "any maskable"
|
||||
},
|
||||
{
|
||||
"src": "../icons/icon-128.webp",
|
||||
"type": "image/png",
|
||||
"sizes": "128x128",
|
||||
"purpose": "any maskable"
|
||||
},
|
||||
{
|
||||
"src": "../icons/icon-192.webp",
|
||||
"type": "image/png",
|
||||
"sizes": "192x192",
|
||||
"purpose": "any maskable"
|
||||
},
|
||||
{
|
||||
"src": "../icons/icon-256.webp",
|
||||
"type": "image/png",
|
||||
"sizes": "256x256",
|
||||
"purpose": "any maskable"
|
||||
},
|
||||
{
|
||||
"src": "../icons/icon-512.webp",
|
||||
"type": "image/png",
|
||||
"sizes": "512x512",
|
||||
"purpose": "any maskable"
|
||||
}
|
||||
]
|
||||
}
|
||||
1
resources/euro_cars_rent_a_car_logo.svg
Normal file
|
After Width: | Height: | Size: 9.8 KiB |