fix binding
This commit is contained in:
parent
a65c6bc394
commit
414654585b
4 changed files with 11 additions and 14 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
type SessionStore struct {
|
||||
|
@ -90,6 +91,7 @@ func (u *User) allowedToAuth() error {
|
|||
}
|
||||
|
||||
func (a *Authenticator) getOrCreateUser(c *Credential) (*User, error) {
|
||||
log.Debug().Str("user", c.user.ProviderUsername()).Msg("getOrCreateUser")
|
||||
panic("not implemented")
|
||||
return &User{}, nil
|
||||
}
|
||||
|
@ -128,9 +130,9 @@ func (c *ClientID) IsValid() bool {
|
|||
}
|
||||
|
||||
type TokenRequest struct {
|
||||
ClientID ClientID `query:"client_id"`
|
||||
Code TokenID `query:"code"`
|
||||
GrantType GrantType `query:"grant_type"`
|
||||
ClientID ClientID `form:"client_id"`
|
||||
Code TokenID `form:"code"`
|
||||
GrantType GrantType `form:"grant_type"`
|
||||
}
|
||||
|
||||
func (a *Authenticator) TokenHandler(c echo.Context) error {
|
||||
|
@ -140,10 +142,6 @@ func (a *Authenticator) TokenHandler(c echo.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if *rq == (TokenRequest{}) {
|
||||
panic("it didn't bind")
|
||||
}
|
||||
|
||||
switch rq.GrantType {
|
||||
case GTAuthorizationCode:
|
||||
if !rq.ClientID.IsValid() {
|
||||
|
|
|
@ -33,7 +33,6 @@ func AliasHandler(toFile string) echo.HandlerFunc {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
func init() {
|
||||
var err error
|
||||
|
||||
|
|
Loading…
Reference in a new issue