mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
Merge pull request #1272 from stephan48/patch-1
Added a checkToken Method for checking the Validity of the API Token
This commit is contained in:
commit
f1ca9bb456
3 changed files with 24 additions and 0 deletions
|
@ -407,3 +407,12 @@ sends a custom message of type `msg` to the pad
|
|||
*Example returns:*
|
||||
* `{code: 0, message:"ok", data: {}}`
|
||||
* `{code: 1, message:"padID does not exist", data: null}`
|
||||
|
||||
#### checkToken()
|
||||
* API >= 1
|
||||
|
||||
returns ok when api token is valid
|
||||
|
||||
*Example returns:*
|
||||
* `{"code":0,"message":"ok","data":null}`
|
||||
* `{"code":4,"message":"no or wrong API Key","data":null}`
|
||||
|
|
|
@ -548,6 +548,19 @@ exports.sendClientsMessage = function (padID, msg, callback) {
|
|||
} );
|
||||
}
|
||||
|
||||
/**
|
||||
checkToken() returns ok when api token is valid
|
||||
|
||||
Example returns:
|
||||
|
||||
{"code":0,"message":"ok","data":null}
|
||||
{"code":4,"message":"no or wrong API Key","data":null}
|
||||
*/
|
||||
exports.checkToken = function(callback)
|
||||
{
|
||||
callback();
|
||||
}
|
||||
|
||||
|
||||
/******************************/
|
||||
/** INTERNAL HELPER FUNCTIONS */
|
||||
|
|
|
@ -68,6 +68,7 @@ var version =
|
|||
, "isPasswordProtected" : ["padID"]
|
||||
, "listAuthorsOfPad" : ["padID"]
|
||||
, "padUsersCount" : ["padID"]
|
||||
, "checkToken" : []
|
||||
}
|
||||
, "1.1":
|
||||
{ "createGroup" : []
|
||||
|
@ -102,6 +103,7 @@ var version =
|
|||
, "padUsers" : ["padID"]
|
||||
, "sendClientsMessage" : ["padID", "msg"]
|
||||
, "listAllGroups" : []
|
||||
, "checkToken" : []
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue