From: erickson Date: Wed, 7 Dec 2005 16:26:30 +0000 (+0000) Subject: auth code now returns { authtoken : , authtime : } as the payload X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=12fcc354fcfe52232600dde7a8de8dcd9a49ee41;p=opensrf%2Fbjwebb.git auth code now returns { authtoken : , authtime : } 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 --- 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;