mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-07-09 15:05:59 +00:00
Merge pull request #284 from jubnl/main
This commit is contained in:
@@ -4,6 +4,7 @@ import { useAuthStore } from '../store/authStore'
|
|||||||
import { useSettingsStore } from '../store/settingsStore'
|
import { useSettingsStore } from '../store/settingsStore'
|
||||||
import { SUPPORTED_LANGUAGES, useTranslation } from '../i18n'
|
import { SUPPORTED_LANGUAGES, useTranslation } from '../i18n'
|
||||||
import { authApi } from '../api/client'
|
import { authApi } from '../api/client'
|
||||||
|
import { getApiErrorMessage } from '../types'
|
||||||
import { Plane, Eye, EyeOff, Mail, Lock, MapPin, Calendar, Package, User, Globe, Zap, Users, Wallet, Map, CheckSquare, BookMarked, FolderOpen, Route, Shield, KeyRound } from 'lucide-react'
|
import { Plane, Eye, EyeOff, Mail, Lock, MapPin, Calendar, Package, User, Globe, Zap, Users, Wallet, Map, CheckSquare, BookMarked, FolderOpen, Route, Shield, KeyRound } from 'lucide-react'
|
||||||
|
|
||||||
interface AppConfig {
|
interface AppConfig {
|
||||||
@@ -171,7 +172,7 @@ export default function LoginPage(): React.ReactElement {
|
|||||||
setShowTakeoff(true)
|
setShowTakeoff(true)
|
||||||
setTimeout(() => navigate('/dashboard'), 2600)
|
setTimeout(() => navigate('/dashboard'), 2600)
|
||||||
} catch (err: unknown) {
|
} catch (err: unknown) {
|
||||||
setError(err instanceof Error ? err.message : t('login.error'))
|
setError(getApiErrorMessage(err, t('login.error')))
|
||||||
setIsLoading(false)
|
setIsLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -152,7 +152,7 @@ app.get('/uploads/photos/:filename', (req: Request, res: Response) => {
|
|||||||
jwt.verify(token, process.env.JWT_SECRET || require('./config').JWT_SECRET);
|
jwt.verify(token, process.env.JWT_SECRET || require('./config').JWT_SECRET);
|
||||||
} catch {
|
} catch {
|
||||||
// Check if it's a share token
|
// Check if it's a share token
|
||||||
const shareRow = db.prepare('SELECT id FROM share_tokens WHERE token = ?').get(token);
|
const shareRow = addonDb.prepare('SELECT id FROM share_tokens WHERE token = ?').get(token);
|
||||||
if (!shareRow) return res.status(401).send('Authentication required');
|
if (!shareRow) return res.status(401).send('Authentication required');
|
||||||
}
|
}
|
||||||
res.sendFile(resolved);
|
res.sendFile(resolved);
|
||||||
|
|||||||
Reference in New Issue
Block a user