From 12fcc354fcfe52232600dde7a8de8dcd9a49ee41 Mon Sep 17 00:00:00 2001
From: erickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Date: Wed, 7 Dec 2005 16:26:30 +0000
Subject: [PATCH] auth code now returns { authtoken : <t> , authtime : <sec> }
 as the payload 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 | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/srfsh/srfsh.c b/src/srfsh/srfsh.c
index de0969b..85edc6d 100644
--- a/src/srfsh/srfsh.c
+++ b/src/srfsh/srfsh.c
@@ -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;
 
-- 
2.11.0