diff options
| author | diogo464 <[email protected]> | 2025-08-24 22:14:12 +0100 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2025-08-24 22:14:12 +0100 |
| commit | 876ec492906f77ee4c18ee236ba2f30ddddb5d10 (patch) | |
| tree | 123ad2b3a0a5616c3b1d2fc52d25caef59e334d8 /frontend/components/drive/DriveDirectoryView.tsx | |
| parent | e4917874be67de24f934e069b53e1726599c6cc5 (diff) | |
feat: add authentication checks for upload and create folder buttons
- Check user authentication before opening file picker or create folder dialog
- Display error toast message when user is not authenticated
- Maintain existing functionality for authenticated users
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Diffstat (limited to 'frontend/components/drive/DriveDirectoryView.tsx')
| -rw-r--r-- | frontend/components/drive/DriveDirectoryView.tsx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/frontend/components/drive/DriveDirectoryView.tsx b/frontend/components/drive/DriveDirectoryView.tsx index de9d70a..b20a111 100644 --- a/frontend/components/drive/DriveDirectoryView.tsx +++ b/frontend/components/drive/DriveDirectoryView.tsx | |||
| @@ -2,6 +2,7 @@ import { DriveLsEntry } from "@/lib/drive_types" | |||
| 2 | import { DriveDirectoryClient } from "./DriveDirectoryClient" | 2 | import { DriveDirectoryClient } from "./DriveDirectoryClient" |
| 3 | import { DriveHeader } from "./DriveHeader" | 3 | import { DriveHeader } from "./DriveHeader" |
| 4 | import type { StorageData } from "@/lib/storage" | 4 | import type { StorageData } from "@/lib/storage" |
| 5 | import { Auth_get_user } from "@/lib/auth" | ||
| 5 | 6 | ||
| 6 | interface DriveDirectoryViewProps { | 7 | interface DriveDirectoryViewProps { |
| 7 | path: string | 8 | path: string |
| @@ -47,6 +48,7 @@ function sortFiles(files: DriveLsEntry[]): DriveLsEntry[] { | |||
| 47 | export async function DriveDirectoryView({ path, files, storageData }: DriveDirectoryViewProps) { | 48 | export async function DriveDirectoryView({ path, files, storageData }: DriveDirectoryViewProps) { |
| 48 | const sortedFiles = sortFiles(files) | 49 | const sortedFiles = sortFiles(files) |
| 49 | const breadcrumbs = generateBreadcrumbs(path) | 50 | const breadcrumbs = generateBreadcrumbs(path) |
| 51 | const userAuth = await Auth_get_user() | ||
| 50 | 52 | ||
| 51 | return ( | 53 | return ( |
| 52 | <div className="container mx-auto p-6 space-y-6"> | 54 | <div className="container mx-auto p-6 space-y-6"> |
| @@ -56,6 +58,7 @@ export async function DriveDirectoryView({ path, files, storageData }: DriveDire | |||
| 56 | files={sortedFiles} | 58 | files={sortedFiles} |
| 57 | breadcrumbs={breadcrumbs} | 59 | breadcrumbs={breadcrumbs} |
| 58 | storageData={storageData} | 60 | storageData={storageData} |
| 61 | userAuth={userAuth} | ||
| 59 | /> | 62 | /> |
| 60 | </div> | 63 | </div> |
| 61 | ) | 64 | ) |
