mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +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:*
|
*Example returns:*
|
||||||
* `{code: 0, message:"ok", data: {}}`
|
* `{code: 0, message:"ok", data: {}}`
|
||||||
* `{code: 1, message:"padID does not exist", data: null}`
|
* `{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 */
|
/** INTERNAL HELPER FUNCTIONS */
|
||||||
|
|
|
@ -68,6 +68,7 @@ var version =
|
||||||
, "isPasswordProtected" : ["padID"]
|
, "isPasswordProtected" : ["padID"]
|
||||||
, "listAuthorsOfPad" : ["padID"]
|
, "listAuthorsOfPad" : ["padID"]
|
||||||
, "padUsersCount" : ["padID"]
|
, "padUsersCount" : ["padID"]
|
||||||
|
, "checkToken" : []
|
||||||
}
|
}
|
||||||
, "1.1":
|
, "1.1":
|
||||||
{ "createGroup" : []
|
{ "createGroup" : []
|
||||||
|
@ -102,6 +103,7 @@ var version =
|
||||||
, "padUsers" : ["padID"]
|
, "padUsers" : ["padID"]
|
||||||
, "sendClientsMessage" : ["padID", "msg"]
|
, "sendClientsMessage" : ["padID", "msg"]
|
||||||
, "listAllGroups" : []
|
, "listAllGroups" : []
|
||||||
|
, "checkToken" : []
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue