diff --git a/app/components/settings/manage/index.jsx b/app/components/settings/manage/index.jsx
index c605cf4..a67aea1 100644
--- a/app/components/settings/manage/index.jsx
+++ b/app/components/settings/manage/index.jsx
@@ -16,7 +16,7 @@ const ManageTeam = () => {
const sortedMembers = team
?.sort((a, b) => a?.permission - b?.permission)
- .sort((a, b) => a?.isVerified - b?.isVerified);
+ .sort((a, b) => b?.isVerified - a?.isVerified);
useEffect(() => {
const fetchTeam = async () => {
diff --git a/docs/api/user.md b/docs/api/user.md
index 3b95989..194f094 100644
--- a/docs/api/user.md
+++ b/docs/api/user.md
@@ -244,7 +244,7 @@ Update the username for the current logged in user.
| ----------- | ---------------------------------------------------------- |
| 200 | Success, username has been updates |
| 400 | Bad Request, displayName not provided or is invalid format |
-| 401 | Unauthorized (Missing `access_token` cookie or API Token) |
+| 401 | Unauthorized (Missing `access_token` cookie) |
| 403 | User is unverified |
@@ -256,7 +256,6 @@ Update the username for the current logged in user.
```[cURL]
curl -X POST
-H "Content-Type:application/json"
- -H "Authorization:API Token"
--data '{"displayName":"Not KSJaay"}'
"https://lunalytics.xyz/api/user/update/username"
```
@@ -265,7 +264,6 @@ curl -X POST
axios('/api/user/update/username', {
method: 'POST',
headers: {
- Authorization: 'API Token',
'Content-Type': 'application/json',
},
data: {
@@ -281,6 +279,65 @@ axios('/api/user/update/username', {
+## Update user password
+
+
+
+### /api/user/update/password
+
+Update the password for the current logged in user.
+
+### Payload
+
+```json
+{
+ "currentPassword": "ReallyOldPassword123",
+ "newPassword": "ReallySecurePassword123"
+}
+```
+
+### HTTP Response Codes
+
+| Status Code | Description |
+| ----------- | ----------------------------------------------------------------------------- |
+| 200 | Success, username has been updates |
+| 400 | Bad Request, currentPassword or newPassword not provided or is invalid format |
+| 401 | Unauthorized (Missing `access_token` cookie or user password is invalid) |
+| 403 | User is unverified |
+
+
+
+
+
+::: code-group
+
+```[cURL]
+curl -X POST
+ -H "Content-Type:application/json"
+ --data '{"currentPassword": "ReallyOldPassword123", "newPassword": "ReallySecurePassword123"}'
+ "https://lunalytics.xyz/api/user/update/password"
+```
+
+```js [axios]
+axios('/api/user/update/password', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ data: {
+ currentPassword: 'ReallyOldPassword123',
+ newPassword: 'ReallySecurePassword123',
+ },
+});
+```
+
+:::
+
+
+
+
+
+
## Update user avatar
@@ -299,12 +356,12 @@ Update the avatar for the current logged in user.
### HTTP Response Codes
-| Status Code | Description |
-| ----------- | --------------------------------------------------------- |
-| 200 | Success, avatar has been updates |
-| 400 | Bad Request, avatar not provided or is invalid format |
-| 401 | Unauthorized (Missing `access_token` cookie or API Token) |
-| 403 | User is unverified |
+| Status Code | Description |
+| ----------- | ----------------------------------------------------- |
+| 200 | Success, avatar has been updates |
+| 400 | Bad Request, avatar not provided or is invalid format |
+| 401 | Unauthorized (Missing `access_token` cookie) |
+| 403 | User is unverified |
@@ -315,7 +372,6 @@ Update the avatar for the current logged in user.
```[cURL]
curl -X POST
-H "Content-Type:application/json"
- -H "Authorization:API Token"
--data '{"avatar":"https://lunalytics.xyz/icons/Gerbil.png"}'
"https://lunalytics.xyz/api/user/update/avatar"
```
@@ -324,7 +380,6 @@ curl -X POST
axios('/api/user/update/avatar', {
method: 'POST',
headers: {
- Authorization: 'API Token',
'Content-Type': 'application/json',
},
data: {
@@ -621,3 +676,104 @@ axios('/api/user/permission/update', {
+
+
+
+## Transfer Ownership
+
+
+
+### /api/user/transfer/ownership
+
+Transfer the ownership of to another user. Only the owner can access this endpoint, and the owners role will then be updated to a guest. This action is irreversible.
+
+### Payload
+
+```json
+{
+ "email": "KSJaay@lunalytics.xyz"
+}
+```
+
+### HTTP Response Codes
+
+| Status Code | Description |
+| ----------- | -------------------------------------------------------------------------- |
+| 200 | Success, ownership has been transferred |
+| 400 | Bad Request, email not provided, user doesn't exist, or invalid permission |
+| 401 | Unauthorized (Missing `access_token` cookie, or user isn't an admin/owner) |
+| 403 | User is unverified |
+
+
+
+
+
+::: code-group
+
+```[cURL]
+curl -X POST
+ -H "Content-Type:application/json"
+ --data '{"email":"KSJaay@lunalytics.xyz"}'
+ "https://lunalytics.xyz/api/user/transfer/ownership"
+```
+
+```js [axios]
+axios('/api/user/transfer/ownership', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ data: {
+ email: 'KSJaay@lunalytics.xyz',
+ },
+});
+```
+
+:::
+
+
+
+
+
+
+## Delete Account
+
+
+
+### /api/user/delete/account
+
+Delete the users account, user won't be able to do this unless they have transferred their ownership.
+
+### HTTP Response Codes
+
+| Status Code | Description |
+| ----------- | ------------------------------------------------------------------- |
+| 200 | Success, delete your account |
+| 401 | Unauthorized (Missing `access_token` cookie, or user doesn't exist) |
+| 403 | User has ownership |
+
+
+
+
+
+::: code-group
+
+```[cURL]
+curl -X POST
+ -H "Content-Type:application/json"
+ "https://lunalytics.xyz/api/user/delete/account"
+```
+
+```js [axios]
+axios('/api/user/delete/account', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+});
+```
+
+:::
+
+
+
diff --git a/docs/internals/changelog.md b/docs/internals/changelog.md
index 43b5e68..df96dcf 100644
--- a/docs/internals/changelog.md
+++ b/docs/internals/changelog.md
@@ -1,5 +1,41 @@
# Previous updates
+## v0.5.0
+
+### Overhaul for settings page
+
+### Summary
+
+This has been a pretty big update, and took a lot longer than I thought it was going to. I decided to overhaul the whole settings page as it was pretty bad UX, and the mobile experience was pretty much unusable. The new UI now renders a different journey for PC and mobile. Both journeys now being a lot more user friendly and easier to use (at least in my opinion). While working on the settings page, I also decided to add a few new customisation features and fixed a few bugs I found.
+
+### New Features
+
+- Settings page overhaul
+- Account management and personalisation moved to their own pages
+- Users can now upload URls for avatars (Still able to select from preset avatars)
+- Ability to change user password
+- Ability to transfer ownership
+- Ability to delete your account (Won't delete monitors you've setup)
+- Added three new endpoints:
+ - `/api/user/update/password`
+ - `/api/user/transfer/ownership`
+ - `/api/user/delete/account`
+- Adds tooltip component
+- `useGoBack` hook to go back a page
+
+### Updates
+
+- Added search bar to status code input
+- Fixes issues with certs not being fetched on initial load
+- Fixes issues with fetching certs crashes server
+- Adds buttons with outlines only
+- Adds icons to text input (left and right side)
+- Reworks timezones files
+- Adds new icons
+- Setup test servers
+- Fixes issues CSS with UX components
+- Fixes issues with random issues on server side
+
## v0.4.7
### Fixes issues with sonner css not loading