very bad demo code

This commit is contained in:
Joe Kralicky 2025-02-18 01:33:15 +00:00
parent b4aa275403
commit d588135b3a
No known key found for this signature in database
GPG key ID: 75C4875F34A9FB79
30 changed files with 1308 additions and 248 deletions

View file

@ -128,7 +128,7 @@ func (p *Provider) SignIn(w http.ResponseWriter, r *http.Request, state string)
return nil
}
func (p *Provider) DeviceAuth(w http.ResponseWriter, r *http.Request) (*oauth2.DeviceAuthResponse, error) {
func (p *Provider) DeviceAuth(ctx context.Context) (*oauth2.DeviceAuthResponse, error) {
oa, err := p.GetOauthConfig()
if err != nil {
return nil, err
@ -144,7 +144,7 @@ func (p *Provider) DeviceAuth(w http.ResponseWriter, r *http.Request) (*oauth2.D
opts = append(opts, oauth2.SetAuthURLParam("client_secret", oa.ClientSecret))
}
resp, err := oa.DeviceAuth(r.Context(), opts...)
resp, err := oa.DeviceAuth(ctx, opts...)
if err != nil {
return nil, err
}