auth code now returns { authtoken : <t> , authtime : <sec> } as the payload
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 7 Dec 2005 16:26:30 +0000 (16:26 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 7 Dec 2005 16:26:30 +0000 (16:26 +0000)
so the OPAC will know what the timeout should be

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@602 9efc2488-bf62-4759-914b-345cdb29e865

src/srfsh/srfsh.c

index de0969b..85edc6d 100644 (file)
@@ -282,14 +282,18 @@ int handle_login( char* words[]) {
                parse_request( buf2 );
 
                jsonObject* x = last_result->_result_content;
+               double authtime = 0;
                if(x) {
-                       char* authtoken = jsonObjectGetString(jsonObjectGetKey(x,"payload"));
+                       char* authtoken = jsonObjectGetString(
+                                       jsonObjectGetKey(jsonObjectGetKey(x,"payload"), "authtoken"));
+                       authtime  = jsonObjectGetNumber(
+                                       jsonObjectGetKey(jsonObjectGetKey(x,"payload"), "authtime"));
                        if(authtoken) login_session = strdup(authtoken);
                        else login_session = NULL;
                }
                else login_session = NULL;
 
-               printf("Login Session: %s\n", login_session );
+               printf("Login Session: %s.  Session timeout: %lf\n", login_session, authtime );
                
                return 1;