@@ -4,11 +4,15 @@ import { db } from "@cap/database";
4
4
import { getCurrentUser } from "@cap/database/auth/session" ;
5
5
import { encrypt , hashPassword , verifyPassword } from "@cap/database/crypto" ;
6
6
import { videos } from "@cap/database/schema" ;
7
+ import type { Video } from "@cap/web-domain" ;
7
8
import { eq } from "drizzle-orm" ;
8
9
import { revalidatePath } from "next/cache" ;
9
10
import { cookies } from "next/headers" ;
10
11
11
- export async function setVideoPassword ( videoId : string , password : string ) {
12
+ export async function setVideoPassword (
13
+ videoId : Video . VideoId ,
14
+ password : string ,
15
+ ) {
12
16
try {
13
17
const user = await getCurrentUser ( ) ;
14
18
@@ -42,7 +46,7 @@ export async function setVideoPassword(videoId: string, password: string) {
42
46
}
43
47
}
44
48
45
- export async function removeVideoPassword ( videoId : string ) {
49
+ export async function removeVideoPassword ( videoId : Video . VideoId ) {
46
50
try {
47
51
const user = await getCurrentUser ( ) ;
48
52
@@ -75,7 +79,10 @@ export async function removeVideoPassword(videoId: string) {
75
79
}
76
80
}
77
81
78
- export async function verifyVideoPassword ( videoId : string , password : string ) {
82
+ export async function verifyVideoPassword (
83
+ videoId : Video . VideoId ,
84
+ password : string ,
85
+ ) {
79
86
try {
80
87
if ( ! videoId || typeof password !== "string" )
81
88
throw new Error ( "Missing data" ) ;
0 commit comments