Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions example-scripts/staff-auth/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# StaffAuth
*A staff authentication script, written for sponge using Kt-Skript in Kotlin*

## Features
- Invite based staff member registration
- SHA-256 password hashing
- Local databases
- Simple command authorisation
- Adds an extra layer of security in case a staff member's account is compromised.

## Examples
Invite a player to register, specifying their role.
```
/staff invite <player> <role>
```
An invite code is generated and stored, the player can either use the invite code to register or click on the chat link.
```
/staff register <invite code>
```
A temporary password is generated and given to player. Their first login is done using their temporary password.
```
/staff login <password>
```
Staff can then change their password using the temporary password.
```
/staff changepassword <old password> <new password>
```
If a staff member forgets their old password, the admin can execute:
```
/staff forcechangepassword <player>
```
and a new temporary password is sent to the player.

Once logged-in the mute command can be executed.
```
/staff mute <player> <duration> <reason>
```
12 changes: 12 additions & 0 deletions example-scripts/staff-auth/staff-auth.imports
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
java.io.File
java.security.MessageDigest
java.util.Base64
java.util.UUID

com.google.gson.Gson
com.google.gson.GsonBuilder
com.google.gson.reflect.TypeToken

org.spongepowered.api.command.CommandSource
org.spongepowered.api.entity.living.player.Player
org.spongepowered.api.network.RemoteConnection
Loading