Skip to content

Commit

Permalink
fix: Implement dynamic login/logout button based on user's logged in …
Browse files Browse the repository at this point in the history
…state [DEV-3092] (#316)

* Add a new endpoint for getting current user info.

* Implement dynamic login/logout button handle based
on user's logged state.

* Update package-lock.json.

* Rename comment message.

* Use isAuthenticated field instead of username for
checking current user authenticate status.

* Change a magic number to const variable.

* Refactor code.

* Rename from `/user` to `/auth/user-info` endpoint.

* bump deps

* Update example.env

* Update example.env

* Remove an unused import.

* Remove dynamically login/logout button.

* Update package-lock.json

---------

Co-authored-by: Ankur Banerjee <ankurdotb@users.noreply.github.com>
Co-authored-by: Andrew Nikitin <andrew.nikitin@cheqd.io>
  • Loading branch information
3 people committed Aug 7, 2023
1 parent 3f5e16b commit 4a2e40d
Show file tree
Hide file tree
Showing 5 changed files with 749 additions and 1,138 deletions.
23 changes: 10 additions & 13 deletions example.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# General
MAINNET_RPC_URL="https://rpc.cheqd.net:443"
TESTNET_RPC_URL="https://rpc.cheqd.network:443"
RESOLVER_URL="https://resolver.cheqd.net/1.0/identifiers/"
Expand All @@ -10,25 +11,21 @@ EXTERNAL_DB_CONNECTION_URL="postgres://<user>:<password>@<host>:<port>/<database
EXTERNAL_DB_ENCRYPTION_KEY="<db-encryption-key>"
EXTERNAL_DB_CERT="<path/to/extenal-db-cert>"

# OpenId
LOGTO_DEFAULT_RESOURCE_URL='http://localhost:8787'

# LogTo
LOGTO_ENDPOINT='http://localhost:3001'
LOGTO_APP_ID='ldfsr...rq432'
LOGTO_APP_SECRET='sdf...sdf'
ENABLE_AUTHENTICATION="false"
LOGTO_ENDPOINT="http://localhost:3001"
LOGTO_APP_ID="ldfsr...rq432"
LOGTO_APP_SECRET="sdf...sdf"
LOGTO_M2M_APP_ID="aaaa...ddddd"
LOGTO_M2M_APP_SECRET="aaaa...ddddd"
LOGTO_MANAGEMENT_API="https://default.logto.app/api"
LOGTO_DEFAULT_RESOURCE_URL="http://localhost:8787"
LOGTO_DEFAULT_ROLE_ID="sdf...sdf"
LOGTO_WEBHOOK_SECRET="sdf...sdf"
COOKIE_SECRET='sdf...sdf'

# Authentication
ENABLE_AUTHENTICATION="false"
COOKIE_SECRET="sdf...sdf"

# verida
ENABLE_VERIDA_CONNECTOR="string,default:false"
# Verida
ENABLE_VERIDA_CONNECTOR="false"
VERIDA_PRIVATE_KEY="akjvncanv....avoa"
POLYGON_PRIVATE_KEY="alnvca...dvncioa"
VERIDA_NETWORK="testnet"
Expand All @@ -37,4 +34,4 @@ VERIDA_NETWORK="testnet"
ISSUER_PRIVATE_KEY_HEX="akjvncanv....avoa"
ISSUER_PUBLIC_KEY_HEX="alnvca...dvncioa"
ISSUER_DID="did:cheqd:testnet:afcnoa...adv"
DEFAULT_FEE_PAYER_MNEMONIC="sketch mountain ....."
DEFAULT_FEE_PAYER_MNEMONIC="sketch mountain ....."
Loading

0 comments on commit 4a2e40d

Please sign in to comment.