code: func (m *AuthMethod) Authenticate(c context.Context, r *http.Request) (*auth.User, error) {
  	if m.SessionStore == nil {
  		return nil, ErrNotConfigured
  	}
  
  	// Grab session ID from the cookie.
  	sid, err := decodeSessionCookie(c, r)
  	if err != nil {
  		return nil, err
  	}
  	if sid == "" {
  		return nil, nil
  	}
  
  	// Grab session (with user information) from the store.
  	session, err := m.SessionStore.GetSession(c, sid)
  	if err != nil {
  		return nil, err
  	}
  	if session == nil {
  		(logging.Fields{"sid": sid}).Warningf(c, "The session cookie references unknown session")
  		return nil, nil
  	}
  	(logging.Fields{
  		"sid":   sid,
  		"email": session.User.Email,
  	}).Debugf(c, "Fetched the session")
  	return &session.User, nil
  }
docs: // Authenticate extracts peer's identity from the incoming request. It is part
  // of auth.Method interface.