Skip to content

Commit

Permalink
feat: 해시값으로 비디오 정보 불러오는 API 구현 완료
Browse files Browse the repository at this point in the history
  • Loading branch information
quiet-honey committed Nov 16, 2023
1 parent f188e5b commit 98cd4b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 1 addition & 4 deletions BE/src/token/strategy/access.token.strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ import { InvalidTokenException } from '../exception/token.exception';
import { Request } from 'express';

@Injectable()
export class AccessTokenStrategy extends PassportStrategy(
Strategy,
'jwt-soft',
) {
export class AccessTokenStrategy extends PassportStrategy(Strategy, 'jwt') {
constructor(private memberRepository: MemberRepository) {
super({
jwtFromRequest: (req: Request) => {
Expand Down
8 changes: 6 additions & 2 deletions BE/src/video/service/video.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,12 @@ export class VideoService {
return VideoDetailResponse.from(video, hash);
}

getVideoDetailByHash(hash: string) {
throw new Error('Method not implemented.');
async getVideoDetailByHash(hash: string) {
const decryptedUrl = this.getDecryptedUrl(hash);
const video = await this.videoRepository.findByUrl(decryptedUrl);

if (!video.isPublic) throw new VideoAccessForbiddenException();
return VideoDetailResponse.from(video, hash);
}

async getAllVideosByMemberId(member: Member) {
Expand Down

0 comments on commit 98cd4b4

Please sign in to comment.