API now checks user credentials before granting tokens.
Added new permission - 'api' that allows the group access to using the API.
This commit is contained in:
parent
839ce793c7
commit
17683eaeaa
2 changed files with 23 additions and 0 deletions
|
|
@ -18,11 +18,18 @@ namespace TShockAPI {
|
|||
public void RegisterRestfulCommands()
|
||||
{
|
||||
Rest.Register(new RestCommand("/status", Status) {RequiesToken = false});
|
||||
Rest.Register(new RestCommand("/tokentest", TokenTest) { RequiesToken = true });
|
||||
//RegisterExamples();
|
||||
}
|
||||
|
||||
#region RestMethods
|
||||
|
||||
object TokenTest(RestVerbs verbs, IParameterCollection parameters)
|
||||
{
|
||||
return new Dictionary<string, string>
|
||||
{{"status", "200"}, {"response", "Token is valid and was passed through correctly."}};
|
||||
}
|
||||
|
||||
object Status(RestVerbs verbs, IParameterCollection parameters)
|
||||
{
|
||||
var ReturnBlock = new Dictionary<string, string>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue