From 83bc2692f98e0b2028d332ec6b9c4fce8a7bbe00 Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Tue, 11 Aug 2015 13:04:11 -0400 Subject: [PATCH] Remove Sys.Login (unused) --- api/sys_login.go | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 api/sys_login.go diff --git a/api/sys_login.go b/api/sys_login.go deleted file mode 100644 index 6d2cc06cf0..0000000000 --- a/api/sys_login.go +++ /dev/null @@ -1,32 +0,0 @@ -package api - -import ( - "fmt" -) - -// Login performs the /sys/login API call. -// -// This API call is stateful: it will set the access token on the client -// for future API calls to be authenticated. The access token can be retrieved -// at any time from the client using `client.Token()` and it can be cleared -// with `sys.Logout()`. -func (c *Sys) Login(vars map[string]string) error { - r := c.c.NewRequest("PUT", "/v1/sys/login") - if err := r.SetJSONBody(vars); err != nil { - return err - } - - resp, err := c.c.RawRequest(r) - if err != nil { - return err - } - defer resp.Body.Close() - - if c.c.Token() == "" { - return fmt.Errorf( - "Login had status code %d, but token cookie was not set!", - resp.StatusCode) - } - - return nil -}