mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-18 19:33:02 -06:00
further oidc
This commit is contained in:
parent
8e0d32d3e1
commit
81206d93f3
14 changed files with 227 additions and 70 deletions
|
|
@ -24,13 +24,8 @@ import (
|
|||
"fmt"
|
||||
)
|
||||
|
||||
func (i *idp) HandleCallback(ctx context.Context, state string, code string) (*Claims, error) {
|
||||
func (i *idp) HandleCallback(ctx context.Context, code string) (*Claims, error) {
|
||||
l := i.log.WithField("func", "HandleCallback")
|
||||
|
||||
if state == "" {
|
||||
return nil, errors.New("state was empty string")
|
||||
}
|
||||
|
||||
if code == "" {
|
||||
return nil, errors.New("code was empty string")
|
||||
}
|
||||
|
|
@ -48,7 +43,7 @@ func (i *idp) HandleCallback(ctx context.Context, state string, code string) (*C
|
|||
if !ok {
|
||||
return nil, errors.New("no id_token in oauth2token")
|
||||
}
|
||||
l.Debug("raw id token: %s", rawIDToken)
|
||||
l.Debugf("raw id token: %s", rawIDToken)
|
||||
|
||||
// Parse and verify ID Token payload.
|
||||
l.Debug("verifying id_token")
|
||||
|
|
@ -66,3 +61,7 @@ func (i *idp) HandleCallback(ctx context.Context, state string, code string) (*C
|
|||
|
||||
return claims, nil
|
||||
}
|
||||
|
||||
func (i *idp) AuthCodeURL(state string) string {
|
||||
return i.oauth2Config.AuthCodeURL(state)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue