Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrections for issue credentials flow #12

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading