code: func (m *AuthMethod) loginHandler(ctx *router.Context) {
  	c, rw, r := ctx.Context, ctx.Writer, ctx.Request
  
  	dest, err := normalizeURL(r.URL.Query().Get("r"))
  	if err != nil {
  		replyError(c, rw, err, "Bad redirect URI (%q) - %s", dest, err)
  		return
  	}
  
  	cfg, err := fetchCachedSettings(c)
  	if err != nil {
  		replyError(c, rw, err, "Can't load OpenID settings - %s", err)
  		return
  	}
  
  	// `state` will be propagated by OpenID backend and will eventually show up
  	// in callback URI handler. See callbackHandler.
  	state := map[string]string{
  		"dest_url": dest,
  		"host_url": r.Host,
  	}
  	authURI, err := authenticationURI(c, cfg, state)
  	if err != nil {
  		replyError(c, rw, err, "Can't generate authentication URI - %s", err)
  		return
  	}
  	http.Redirect(rw, r, authURI, http.StatusFound)
  }
docs: ////
  // loginHandler initiates login flow by redirecting user to OpenID login page.