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

Universal link Integration and UI changes #38

Merged
merged 4 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
26 changes: 15 additions & 11 deletions verifier-integration/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ const path = require("path");
const express = require("express");
const { auth, resolver, protocol } = require("@iden3/js-iden3-auth");
const getRawBody = require("raw-body");

const cors = require('cors');
const app = express();
const port = 8080;

app.use(express.static("../static"));
app.use(cors());

app.get("/api/sign-in", (req, res) => {
console.log("get Auth Request");
Expand Down Expand Up @@ -75,20 +76,23 @@ async function callback(req, res) {
// get JWZ token params from the post request
const raw = await getRawBody(req);
const tokenStr = raw.toString().trim();
console.log(tokenStr);

const ethURL = "<AMOY_URL>";
const contractAddress = "0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124";
const keyDIR = "../keys";

const ethStateResolver = new resolver.EthStateResolver(
ethURL,
contractAddress
);

const resolvers = {
["polygon:amoy"]: ethStateResolver,
};
["polygon:amoy"]: new resolver.EthStateResolver(
"<Polygon_Amoy_RPC_URL>",
"0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124"
),
["privado:main"]: new resolver.EthStateResolver(
"https://rpc-mainnet.privado.id",
"0x975556428F077dB5877Ea2474D783D6C69233742"
),
["privado:test"]: new resolver.EthStateResolver(
"https://rpc-testnet.privado.id/",
"0x975556428F077dB5877Ea2474D783D6C69233742"
)
};

// fetch authRequest from sessionID
const authRequest = requestMap.get(`${sessionId}`);
Expand Down
Loading