Skip to content

Commit

Permalink
se elminan credenciales
Browse files Browse the repository at this point in the history
  • Loading branch information
JamiltonQuintero committed Aug 30, 2024
1 parent b4ca4f8 commit 10fc80c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/app/(routes)/interview/video-call/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { Button } from "@/components/ui/button"
import { OptionsDialog } from './dialog'
import { VideoCall } from './videoCall'
import { InterviewerList } from './interviewerListProps '

const api_token = "MDdlYzkyNjljY2M2NDQyZjg1ZTAwYjQxMDQ2OWZkMGYtMTcyMjM5NzAxMA=="
const NEXT_PUBLIC_API_TOKEN = process.env.NEXT_PUBLIC_API_TOKEN;

interface Avatar {
avatar_id: string;
Expand All @@ -35,13 +34,13 @@ export default function Page() {

useEffect(() => {
const fetchAvatars = async () => {
if (!api_token) {
if (!NEXT_PUBLIC_API_TOKEN) {
throw new Error("API token is not defined")
}
try {
const response = await fetch('https://api.heygen.com/v2/avatars', {
headers: {
'x-api-key': api_token,
'x-api-key': NEXT_PUBLIC_API_TOKEN,
},
})
if (!response.ok) throw new Error('Failed to fetch avatars')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { TokenVideoChatManager } from '../../domain/model/videoChatManager';
import { VideoChatManagerRepositoryPort } from '../../domain/port/videoChatManagerRepositoryPort';
const api_token = "MDdlYzkyNjljY2M2NDQyZjg1ZTAwYjQxMDQ2OWZkMGYtMTcyMjM5NzAxMA=="
const NEXT_PUBLIC_API_TOKEN = process.env.NEXT_PUBLIC_API_TOKEN;

export const createVideoChatManagerRepositoryAdapter = (): VideoChatManagerRepositoryPort => {
return {
getToken: async (): Promise<TokenVideoChatManager> => {
if (!api_token) {
if (!NEXT_PUBLIC_API_TOKEN) {
throw new Error("API token is not defined")
}

Expand All @@ -15,7 +15,7 @@ export const createVideoChatManagerRepositoryAdapter = (): VideoChatManagerRepos
{
method: "POST",
headers: {
"x-api-key": api_token,
"x-api-key": NEXT_PUBLIC_API_TOKEN,
"content-type": "application/json",
},
body: JSON.stringify({}),
Expand Down
3 changes: 2 additions & 1 deletion src/types/node-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ declare namespace NodeJS {
KC_CLIENT_SECRET: string
KC_ISSUER: string,
KC_REDIRECT_URI: string,
NEXTAUTH_URL: string
NEXTAUTH_URL: string,
NEXT_PUBLIC_API_TOKEN: string,
}
}

0 comments on commit 10fc80c

Please sign in to comment.