From be2f16214fbeab82f781798cc2c24fbd3d88d9ce Mon Sep 17 00:00:00 2001 From: Evgen Kostenko <evgeniy.kostenko@mev.com> Date: Wed, 1 Jun 2016 15:52:52 +0300 Subject: [PATCH] get Authenticated reports session from main repository --- authentication.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/authentication.go b/authentication.go index 0ff891e..2ef88c4 100644 --- a/authentication.go +++ b/authentication.go @@ -69,6 +69,14 @@ func (s *AuthenticationService) AcquireSessionCookie(username, password string) return true, nil } +// Authenticated reports if the current Client has an authenticated session with JIRA +func (s *AuthenticationService) Authenticated() bool { + if s != nil { + return s.client.session != nil + } + return false +} + // TODO Missing API Call GET (Returns information about the currently authenticated user's session) // See https://docs.atlassian.com/jira/REST/latest/#auth/1/session // TODO Missing API Call DELETE (Logs the current user out of JIRA, destroying the existing session, if any.)