auth
auth/client/login.go
Use an environment variable to set the JWT secret. When setting up the authd server, populate the JWT secret using a JWT_SECRET environment variable. Incidentally, we also included the subscriptions scope, for testing purposes while creating code.secondbit.org/ducky/subscriptions. We now also log the port we're listening on, listen on all interfaces (instead of just 127.0.0.1), and changed the port to 9000 instead of 8080.
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 }