User

Auth

User Endpoints

Nonce ( get )

`https://api.unipos.org/users/nonce?address=${0x{string}}`

Response

body: string

Verify ( post )

`https://api.unipos.org/users/verify`

Request

import { SiweMessage } from 'siwe'
import { useSignMessage } from 'wagmi'
const { signMessageAsync } = useSignMessage()

const message = new SiweMessage({
      address: `0x${string}`,
      chainId: number,
      domain: window.location.host,
      nonce: string,
      statement: 'Sign in with the Blockchain to Unipos.',
      uri: window.location.origin,
      version: '1',
})

const signature = await signMessageAsync({
      message: message.prepareMessage()
})

body: { message, signature }

Response

// With Cookie header 'access_token'
body: {
    address: `0x${string}`
    role: string
}

Identify ( get )

`https://api.unipos.org/users/identify`

Request

// With Cookie header 'access_token'

Response

body: {
    address: `0x${string}`
    role: string
}

Logout ( get )

`https://api.unipos.org/users/logout`

Request

// With Cookie header 'access_token'

Response

status 200 | 403

Last updated