Skip to content
nopeless edited this page Dec 16, 2021 · 7 revisions

Login

Idk someone clean this up later

interface User {
    name: string,
    username: string,
    hash: string, // private
    salt: string, // private
    ranks: [string],
    groups: [string]
    ...
}

access_token {
  sub: string, //userid,
  type: "REFRESH",
  ranks: [string],
  groups: [string],
}

refresh_token {
  sub: string, //userid
  type: "REFRESH",
}

--------------------------

POST /auth/register

data: {
    username: string,
    name: string, // defaults to username
    password: string
}

response: {
    access_token: string,
    refresh_token: string,
    user: User
}

--------------------------

POST /auth/login

data: {
    username: string,
    password: string
}

response: {
    access_token: string,
    refresh_token: string,
    user: User
}

--------------------------

POST /auth/refresh

data: {
    refresh_token: string
}

response: {
    access_token: string
}
Clone this wiki locally