auth

Paddy 2015-07-18 Parent:b0d1b3e39fc8 Child:4b68bac597b7

179:7bba108d2d9a Go to Latest

auth/client/login.go

Send events when logins are verified. Add an ActionLoginVerified constant to use as the action when a login has been verified. On second thought, this should probably just be "verified", huh? Then we can reuse it across models. Oops. We also added a call to send a login verified event to NSQ when the login is verified.

History
1 package client
3 import (
4 "code.secondbit.org/auth.hg"
5 )
7 func (c *Client) GetLogin(value string) (auth.Login, error) {
8 resp, err := c.Get("/logins/"+value, auth.Scopes{auth.ScopeLoginAdmin}.Strings(), nil)
9 if err != nil {
10 return auth.Login{}, err
11 }
12 if len(resp.Logins) < 1 {
13 return auth.Login{}, auth.ErrLoginNotFound
14 }
15 return resp.Logins[0], nil
16 }