Skip to content

Commit

Permalink
Merge branch 'release-0.10.x' of https://github.com/mosip/inji-verify
Browse files Browse the repository at this point in the history
…into develop

Signed-off-by: srikanth716 <[email protected]>
  • Loading branch information
srikanth716 committed Oct 7, 2024
1 parent 6829b6e commit 59540d7
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions inji-verify/src/utils/ovp-utils.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import {OvpQrHeader} from "./config";
import { OvpQrHeader } from "./config";

export const extractRedirectUrlFromQrData = (qrData: string) => {
// qr data format = OVP://payload:text-content
const regex = new RegExp(`^${OvpQrHeader}(.*)$`);
const match = qrData.match(regex);
return match ? match[1] : null;
}
// qr data format = OVP://payload:text-content
const regex = new RegExp(`^${OvpQrHeader}(.*)$`);
const match = qrData.match(regex);
return match ? match[1] : null;
};

export const initiateOvpFlow = (redirectUri: string) => {
const encodedClintIdUrl = window.encodeURIComponent(OvpClientId);
const encodedRedirectUrl = window.encodeURIComponent(window.location.origin);
window.location.href = `${redirectUri}&client_id=${encodedClintIdUrl}&redirect_uri=${encodedRedirectUrl}/redirect`;
}
const encodedOriginUrl = window.encodeURIComponent(window.location.origin);
window.location.href = `${redirectUri}&client_id=${encodedOriginUrl}&redirect_uri=${encodedOriginUrl}/redirect`;
};

0 comments on commit 59540d7

Please sign in to comment.