blob: 6af671ecca8c9f6d887dae07f09625847eafcf9c [file] [log] [blame]
TheCodedProf2a69bd92023-03-02 16:36:32 -05001import Axios from 'axios';
2
3const t = () => { return <></>}
4export default t
5export async function getServerSideProps(ctx) {
6 if(!ctx.params.code) {
7 return {
8 redirect: {
9 destination: '/nucleus/transcript/about',
10 permanent: true
11 }
12 }
13 }
14 let code;
15 try {
Skyler Grey6c3d4632023-03-06 09:51:21 +000016 code = (await Axios.get(`${process.env.NUCLEUS_CALLBACK}transcript/${ctx.params.code}?key=${ctx.query.key}&iv=${ctx.query.iv}`))
TheCodedProf2a69bd92023-03-02 16:36:32 -050017 } catch (e) {
18 return {
19 redirect: {
20 destination: '/nucleus/transcript/invalid',
21 permanent: true
22 }
23 }
24 }
25 return {
26 redirect: {
Skyler Grey6c3d4632023-03-06 09:51:21 +000027 destination: `${process.env.NUCLEUS_CALLBACK}transcript/${ctx.params.code}?key=${ctx.query.key}&iv=${ctx.query.iv}/human`,
TheCodedProf2a69bd92023-03-02 16:36:32 -050028 permanent: true
29 }
30 }
Samuel Shuert61ddba12023-03-05 21:19:11 -050031}