JWT based auth practice https://anymore0505.github.io/official-site/blog/article/9
測試普通權限的 endpoint
header 帶 authorization Bearer accessToken
註冊 endpoint
帶 body json
{
"name": "Paul",
"account": "youraccount",
"password": "yourpwd"
}
登入 endpoint
帶 body json
{
"account": "youraccount",
"password": "yourpwd"
}
回傳
{
"accessToken": "your accessToken",
"refreshToken": "your refreshToken"
}
登出 endpoint
帶 body json
{
"refreshToken": "refreshToken"
}
用refreshToken 換 accessToken endpoint
帶 body json
{
"refreshToken": "refreshToken"
}
回傳
{
"accessToken": "your accessToken"
}
更改密碼 endpoint
header 帶 authorization Bearer accessToken
帶 body json
{
"originalPwd": "originalPwd",
"newPwd": "newPwd"
}