- switch(verb->session) {
- case AFB_SESSION_CREATE:
- if (!afb_req_session_create(req))
- return;
- break;
- case AFB_SESSION_RENEW:
- if (!afb_req_session_check(req, 1))
+ int stag = (int)(verb->session & AFB_SESSION_MASK);
+
+ if (stag != AFB_SESSION_NONE) {
+ if (!afb_context_check(context)) {
+ afb_context_close(context);
+ afb_req_fail(req, "failed", "invalid token's identity");