-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6160d48
commit ab09e64
Showing
3 changed files
with
29 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
import { Controller } from "@tsed/di"; | ||
import { Controller, Inject } from "@tsed/di"; | ||
import { Get, Hidden, View } from "@tsed/schema"; | ||
import { Authorize } from "@tsed/passport"; | ||
import type { CustomUserInfoModel } from "../../model/auth/CustomUserInfoModel"; | ||
import { Req } from "@tsed/common"; | ||
import type { Request } from "express"; | ||
import { BucketService } from "../../services/BucketService.js"; | ||
|
||
@Controller("/bucket") | ||
@Hidden() | ||
export class BucketView { | ||
public constructor(@Inject() private bucketService: BucketService) {} | ||
|
||
@Get() | ||
@View("/secure/files.ejs") | ||
@Authorize("bucketAuthProvider") | ||
public showBucketPage(@Req() req: Request): unknown { | ||
public async showBucketPage(@Req() req: Request): Promise<unknown> { | ||
const bucket = await this.bucketService.getBucket(); | ||
return { | ||
user: req.user as CustomUserInfoModel, | ||
bucket, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters