Skip to content

Commit

Permalink
remove only value instead of tx_code obj and show OTP pass to the user (
Browse files Browse the repository at this point in the history
#12)

Co-authored-by: Paris Smirlakis <[email protected]>
  • Loading branch information
SmirlakisParis and smirlakis authored Sep 19, 2024
1 parent e9fa228 commit 89fe9fb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 84 deletions.
4 changes: 1 addition & 3 deletions src/client/components/organisms/AppLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Fragment } from "react";
import { ToastContainer } from "react-toastify";
import Footer from "../organisms/Footer";
import Header from "../organisms/Header";
import { Box } from "@mui/material";

Expand All @@ -22,8 +21,7 @@ const AppLayout = ({ children }: AppLayoutProps) => (
>
{children}
</Box>
<Footer />
</Fragment>
</Fragment>
);

export default AppLayout;
78 changes: 0 additions & 78 deletions src/client/components/organisms/Footer.tsx

This file was deleted.

14 changes: 12 additions & 2 deletions src/pages/confirmation/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ModalStatus, useAppStore } from "@/client/store";
import { useBookingStore } from "@/client/store/bookingStore";
import { deviceDetect } from "@/helpers/deviceDetect";
import { BookingService } from "@/server";
import { Box } from "@mui/material";
import { Box, Typography } from "@mui/material";
import { GetServerSideProps, GetServerSidePropsContext } from "next";
import { AppProps } from "next/app";
import QRCode from "react-qr-code";
Expand All @@ -27,7 +27,17 @@ export default function ConfirmationPage(props: AppProps) {
<Box sx={{width: '100%', maxWidth:'100%',pb:1,pt:1,pl:3,pr:3}}>
<Modal
title="Scan to issue your reservation confirmation to EUDI Wallet"
content={issueConfirmationRes?.url && <QRCode value={issueConfirmationRes.url} />}
content={
<Box>
{issueConfirmationRes &&
<Box>
{issueConfirmationRes?.url && <QRCode value={issueConfirmationRes.url} />}
{issueConfirmationRes?.otp && <Typography variant="h5" color="textPrimary">OTP: {issueConfirmationRes.otp}</Typography>}
</Box>
}
</Box>

}
handleClose={()=>{ changeModalStatus(ModalStatus.CLOSE) }}
/>

Expand Down
3 changes: 2 additions & 1 deletion src/server/services/IssuerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export class IssuerService {
}

const responseData = await response.json();

const otp =
responseData.grants[
"urn:ietf:params:oauth:grant-type:pre-authorized_code"
Expand All @@ -90,7 +91,7 @@ export class IssuerService {
const responseCopy = { ...responseData };
delete responseCopy.grants[
"urn:ietf:params:oauth:grant-type:pre-authorized_code"
].tx_code;
].tx_code.value;

const urlEncodedResponse = encodeURIComponent(
JSON.stringify(responseCopy)
Expand Down

0 comments on commit 89fe9fb

Please sign in to comment.