-// Dummy sample of Client Application Context
-typedef struct {
- int something;
- void *whateveryouwant;
-} MyClientApplicationHandle;
-
-
-// Request Creation of new context if it does not exist
-STATIC json_object* clientContextCreate (AFB_request *request) {
- json_object *jresp;
-
- // add an application specific client context to session
- request->client->ctx = malloc (sizeof (MyClientApplicationHandle));
-
- // Send response to UI
- jresp = json_object_new_object();
- json_object_object_add(jresp, "token", json_object_new_string ("A New Token and Session Context Was Created"));
-
- return (jresp);
-}
-
-// Before entering here token will be check and renew
-STATIC json_object* clientContextRefresh (AFB_request *request) {
- json_object *jresp;
-
-
- jresp = json_object_new_object();
- json_object_object_add(jresp, "token", json_object_new_string ("Token was refreshed"));
-
- return (jresp);
-}
-
-
-// Session token will we verified before entering here
-STATIC json_object* clientContextCheck (AFB_request *request) {
-
- json_object *jresp = json_object_new_object();
- json_object_object_add(jresp, "isvalid", json_object_new_boolean (TRUE));
-
- return (jresp);
-}
-
-
-// Close and Free context
-STATIC json_object* clientContextReset (AFB_request *request) {
- json_object *jresp;
-
- jresp = json_object_new_object();
- json_object_object_add(jresp, "uuid", json_object_new_string (request->client->uuid));
-
- return (jresp);
-}