diff --git a/node/basic/index.ts b/node/basic/index.ts index 241ea984..f043087e 100644 --- a/node/basic/index.ts +++ b/node/basic/index.ts @@ -6,8 +6,7 @@ async function signedInSearch() { let service = new TrinsicService(); let loginResponse = await service.account().login({ email: "scott.phillips@trinsic.id", - ecosystemId: "", - invitationCode: "", + ecosystemId: "default" }); let code = rlsync.question("Enter the security code sent to your email:") ?? ""; @@ -22,7 +21,8 @@ async function signedInSearch() { async function main() { let service = new TrinsicService(); - await service.account().loginAnonymous(); + const authenticationToken = await service.account().loginAnonymous("default"); + console.log("Authentication token", authenticationToken) let searchResponse = await service.wallet().searchWallet(); console.log(searchResponse.items); diff --git a/node/express/index.ts b/node/express/index.ts index 1f7dbcfb..a022cd82 100644 --- a/node/express/index.ts +++ b/node/express/index.ts @@ -2,18 +2,7 @@ import express from "express"; import { Express, Request, Response } from "express"; import "dotenv/config"; import { - CreateCredentialTemplateRequest, - CreateEcosystemRequest, - CreateProofRequest, - FieldType, - InsertItemRequest, - IssueFromTemplateRequest, - TemplateData, - TemplateField, - TrinsicService, - VerifyProofRequest, - ServiceOptions, - EcosystemInfoRequest, + TrinsicService } from "@trinsic/trinsic"; //----------------- @@ -22,17 +11,18 @@ const port = 8000; //----------------- async function getEcoSystemId() { - const trinsic = new TrinsicService(); - - trinsic.setAuthToken(process.env.AUTHTOKEN || ""); - - const infoResponse = await trinsic - .provider() - .ecosystemInfo(EcosystemInfoRequest.fromPartial({})); - - const ecosystem = infoResponse.ecosystem; - - return ecosystem?.id; + try { + const trinsic = new TrinsicService(); + + trinsic.setAuthToken(process.env.AUTHTOKEN || ""); + + const accountInfo = await trinsic.account().info(); + return accountInfo.ecosystemId; + } + catch(e){ + console.error(e); + return "ERROR" + e; + } } //----------------- diff --git a/node/kubernetes/index.ts b/node/kubernetes/index.ts index 76614cde..8bbee75d 100644 --- a/node/kubernetes/index.ts +++ b/node/kubernetes/index.ts @@ -46,10 +46,8 @@ async function start() { }) app.post('/login',async (req, res) => { - systemState.loginResponse = await trinsicService.account().login({email: req.body.emailAddress, - ecosystemId: "default", - invitationCode: undefined - }); + systemState.userAccountString = req.body.emailAddress; + systemState.loginResponse = await trinsicService.account().login({email: req.body.emailAddress, ecosystemId: "default"}); res.render('login', systemState) })