๐Ÿ”“Auth

Logins to app by proving ownership of the address.

post

This route verifies the signature and the address provided. The route first checks if the nonce has been correctly signed by the user. The route then creates a session and generates tokens if the ownership of the public address is proven.

Body
addressstringoptional
signaturestringoptional
Responses
curl -L \
  --request POST \
  --url 'https://www.dyorbackend.tk/api/v1/auth/login' \
  --header 'Content-Type: application/json' \
  --data '{
    "address": "text",
    "signature": "text"
  }'
{
  "ok": true,
  "result": {
    "access": "text",
    "refresh": "text"
  }
}

Gets nonce of a given wallet.

get

This route retrieves the cryptographic nonce of a wallet by address.The route first queries the database for the wallet by address provided.The route then returns the nonce of the found wallet.

Path parameters
addressstringrequired
Responses
curl -L \
  --url 'https://www.dyorbackend.tk/api/v1/auth/nonce/{address}'
{
  "ok": true,
  "result": {
    "nonce": 608560748621946800000
  }
}

Logs out of the app by deleting session.

delete

This route logouts of the app.The route first checks and finds the session saved in the database.The route then deletes the session found related to the wallet.

Responses
curl -L \
  --request DELETE \
  --url 'https://www.dyorbackend.tk/api/v1/auth/logout'
{
  "ok": true,
  "result": {}
}

Refreshes the wallet session and generates new tokens.

get

This route refreshes the wallet session.The route first checks and finds the wallet session saved in the database.The route then deletes the session, creates a new one and generates new tokens.

Responses
curl -L \
  --url 'https://www.dyorbackend.tk/api/v1/auth/refresh'
{
  "ok": true,
  "result": {
    "access": "text",
    "refresh": "text"
  }
}

Last updated