Skip to content

Commit d170459

Browse files
aeneasrory-bot
authored andcommitted
chore: simplify CreateDeviceUserAuthRequest
GitOrigin-RevId: 8210b6b3b90e3f83a1a18b12768b10d758492ee4
1 parent 14d838c commit d170459

File tree

8 files changed

+103
-280
lines changed

8 files changed

+103
-280
lines changed

CHANGELOG.md

Lines changed: 2 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
55
**Table of Contents**
66

7-
- [0.0.0 (2025-08-26)](#000-2025-08-26)
7+
- [0.0.0 (2025-07-03)](#000-2025-07-03)
88
- [Breaking Changes](#breaking-changes)
99
- [Related issue(s)](#related-issues)
1010

1111
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
1212

13-
# [0.0.0](https://github.com/ory/hydra/compare/v2.3.0...v0.0.0) (2025-08-26)
13+
# [0.0.0](https://github.com/ory/hydra/compare/v2.3.0...v0.0.0) (2025-07-03)
1414
## Breaking Changes
1515

1616
This patch changes the behavior of configuration item `foo` to do bar. To keep the existing
@@ -41,10 +41,6 @@ If this pull request
4141

4242
### Bug Fixes
4343

44-
* Add repo syncing for polis ([46d17f8](https://github.com/ory/hydra/commit/46d17f8bfdc59e2185e9ce65823eb2652e01f1b8)):
45-
46-
GitOrigin-RevId: e277a25d594b512b800d39dd18f36ea3d99fcf84
47-
4844
* Allow updating when JWKS URI is set ([#3935](https://github.com/ory/hydra/issues/3935)) ([#3946](https://github.com/ory/hydra/issues/3946)) ([fb1655b](https://github.com/ory/hydra/commit/fb1655ba86077b10141132ed332ba8d6f8c70582)):
4945

5046
The client validator no longer rejects PATCH and PUT updates when `JSONWebKeysURI` is non-empty and `JSONWebKeys` is not nil.
@@ -75,10 +71,6 @@ If this pull request
7571
GitOrigin-RevId: 61645585277edd95914705499afd7211a85983eb
7672

7773
* CLI usage help examples ([#3943](https://github.com/ory/hydra/issues/3943)) ([e24f9a7](https://github.com/ory/hydra/commit/e24f9a704c22c72690bc20c498439865181d9239))
78-
* Copybara script ([7b33358](https://github.com/ory/hydra/commit/7b333585bb44a069bf47267c853aa2e91db0efa3)):
79-
80-
GitOrigin-RevId: 14665e01451ac5fcdda148b473b8fc35d4fe21ef
81-
8274
* Correct multiple instances of 'stragegy' typo ([#3906](https://github.com/ory/hydra/issues/3906)) ([50eefbc](https://github.com/ory/hydra/commit/50eefbc21c2c43d221b6079bbd78a33ef8c754c4)):
8375

8476
This commit addresses several occurrences where 'strategy' was
@@ -88,22 +80,6 @@ If this pull request
8880
documentation repository (ory/docs), with a corresponding pull request
8981
submitted.
9082

91-
* Deduplicate down migrations ([02baf36](https://github.com/ory/hydra/commit/02baf364c5f1fe09a74edb879c711983f761dc7f)):
92-
93-
GitOrigin-RevId: 94c68daeded4f3b6f42d079d71415d8935a74e69
94-
95-
* **deps:** Update go-x ([582a3c5](https://github.com/ory/hydra/commit/582a3c5f2de833a7996812d4873b305d162e1c7b)):
96-
97-
GitOrigin-RevId: 2d32f7710b9c6111a30f4e0d3cc0abc967d7dfb6
98-
99-
* Failing CI in OSS repos ([c900985](https://github.com/ory/hydra/commit/c9009858dc96edbbec1dd256cb1a734beb4f90aa)):
100-
101-
GitOrigin-RevId: 3d1f84b0f0d006971aea9489322b3e0f32a6a7e3
102-
103-
* Fix expires_at timestamp not in UTC leading to local test failures ([337000a](https://github.com/ory/hydra/commit/337000aacd07a1af6e77918a011903b6f39701a3)):
104-
105-
GitOrigin-RevId: 560d958391b12ace6db9d4c05074719e96e0329e
106-
10783
* Force autocommit for device auth code migration ([#3991](https://github.com/ory/hydra/issues/3991)) ([29761f4](https://github.com/ory/hydra/commit/29761f4ac7586478ea6f553cb571ac11b0275e6d)), closes [#1234](https://github.com/ory/hydra/issues/1234) [#1234](https://github.com/ory/hydra/issues/1234):
10884

10985
<!--
@@ -117,30 +93,14 @@ If this pull request
11793

11894
```
11995

120-
* **hydra:** Instrument metrics also on public endpoints ([8aee364](https://github.com/ory/hydra/commit/8aee364805a0fa20cd5d786324efb5c6e5cdfcb5)):
121-
122-
GitOrigin-RevId: 84ae1df26bd3d9a025655e50792ea7312f250cca
123-
124-
* Identity queries ([a30f021](https://github.com/ory/hydra/commit/a30f021fd98969c2dbc31a4dc3e45365d60c1a25)):
125-
126-
GitOrigin-RevId: b103d25a807c643b521a12d593486d5125f390be
127-
12896
* Ignore flaky keys in Hydra HSM tests ([469b2ad](https://github.com/ory/hydra/commit/469b2ad538865a38738a10f46d270f53d12101ad)):
12997

13098
GitOrigin-RevId: 83312e6544bc33ccc30e1e1e414cc04910429192
13199

132-
* Include go.mod in vendored oryx ([08a3ab4](https://github.com/ory/hydra/commit/08a3ab43ddb1e2a0df430224f969fe3f0ba161bf)):
133-
134-
GitOrigin-RevId: 20365bbe6b2cf95ac7973bcca9056455d2cb3803
135-
136100
* **infrastructure:** Hydra oss CI ([e846541](https://github.com/ory/hydra/commit/e84654185cdfffbf160d5309f744795d15d723f9)):
137101

138102
GitOrigin-RevId: 3df0724e5ea4c81a0f4c481c1a3a34529356d073
139103

140-
* Jsonx.ApplyJSONPatch ([c6fa2a6](https://github.com/ory/hydra/commit/c6fa2a6f17f63e43cfecb576bd2a1c1b58c778ed)):
141-
142-
GitOrigin-RevId: 43c10801f5051e3d5fbea5f4f5e90394f6da0fbb
143-
144104
* JWT documentation link to point to the correct resource ([#3907](https://github.com/ory/hydra/issues/3907)) ([b746e41](https://github.com/ory/hydra/commit/b746e41eda6dc3fe376b147d146a6fcc7dafb455)):
145105

146106
The previous link in the documentation led to a page unrelated to JWT.
@@ -168,23 +128,7 @@ If this pull request
168128
persistence/sql/src/20220210000001_nid/20220210000001000000_nid.cockroach.up.sql
169129
```
170130

171-
* Otlp sampling rate default ([cbd5094](https://github.com/ory/hydra/commit/cbd50947ff7e03a4c32d0ad52acd55b595b393ce)):
172-
173-
GitOrigin-RevId: 8a01bded7d8eca0ac3a81de793286144aab16426
174-
175-
* Print correct content of down migrations ([4a4a088](https://github.com/ory/hydra/commit/4a4a0880dc6222870b1e177ce04f81842359f922)):
176-
177-
GitOrigin-RevId: 48b1efa8d3d4f6c6648d3941f67f622fdfb0075c
178-
179-
* Revert "fix: otlp sampling rate default ([#9055](https://github.com/ory/hydra/issues/9055))" ([02e86bc](https://github.com/ory/hydra/commit/02e86bc192c8f693c23aa430481a1e719d8e2e21)):
180-
181-
GitOrigin-RevId: 9de37a48b68c7ee29caefb01c83f1a78999dc15b
182-
183131
* Revoke by consent request ID ([#3947](https://github.com/ory/hydra/issues/3947)) ([5d8635c](https://github.com/ory/hydra/commit/5d8635c94389ff3c87bfae66afe95105c147bec1)), closes [#3932](https://github.com/ory/hydra/issues/3932) [#3932](https://github.com/ory/hydra/issues/3932) [#3941](https://github.com/ory/hydra/issues/3941)
184-
* Routes in AX with identity_schema ([5014348](https://github.com/ory/hydra/commit/50143483fd66fb7d545e8a8e2c7e95857f35fbbb)):
185-
186-
GitOrigin-RevId: ab72dc64c194c06bf0301e87aa829c72022ac41e
187-
188132
* Simplify and fix Copybara sync job ([f998d09](https://github.com/ory/hydra/commit/f998d090ca6408b05524aea5e5f3a79c5d44b1a4)):
189133

190134
GitOrigin-RevId: 115f1ba1aa8f92d9c546046b37d4fb27dacedec8
@@ -201,14 +145,6 @@ If this pull request
201145

202146
GitOrigin-RevId: 64950988a466bbdb4f25b8d9f5c416ff591c00bf
203147

204-
* Use hard-coded fallback key instead of panic ([e1f6450](https://github.com/ory/hydra/commit/e1f645012f43f62928fdc79710b45d935878367f)):
205-
206-
GitOrigin-RevId: d7a2270bbf5360288199e9632b2eac6cbc29737c
207-
208-
* Use main branch for polis ([6c24e68](https://github.com/ory/hydra/commit/6c24e68995b8eae9ba0b8872867270ef1d35113b)):
209-
210-
GitOrigin-RevId: 04533493184c6abdc3a211daffd98f6b68e1c9cc
211-
212148
* Using uuid_generate_v4 function ([#3958](https://github.com/ory/hydra/issues/3958)) ([c206066](https://github.com/ory/hydra/commit/c20606606654af975e5d82998956bb998acee576)):
213149

214150
Removing the md5 function for the uuid generation with native pgsql
@@ -217,19 +153,8 @@ If this pull request
217153
Closes https://github.com/ory/hydra/issues/3844
218154

219155

220-
### Code Refactoring
221-
222-
* Move database meta functions to root x folder for reusability ([7e49133](https://github.com/ory/hydra/commit/7e49133f435d6a0f74a63e8f8d03c5d314d7d3c6)):
223-
224-
GitOrigin-RevId: 30ee938ea5f1d19bac8967e0ebfe2d595ec27d2b
225-
226-
227156
### Features
228157

229-
* Add allowed domains configuration for captcha ([df3f05c](https://github.com/ory/hydra/commit/df3f05c6ffbd3f00e62a33b2b68416ccf2009112)):
230-
231-
GitOrigin-RevId: 03395362054593f07ff6405c2a747256b5ff528e
232-
233158
* Add error reason to OAuth2TokenExchangeError event ([#3971](https://github.com/ory/hydra/issues/3971)) ([241dd45](https://github.com/ory/hydra/commit/241dd45fa17ed10d1101d890199df47dab4dbce5))
234159
* Add handler for /.well-known/oauth-authorization-server. ([#3980](https://github.com/ory/hydra/issues/3980)) ([5baca28](https://github.com/ory/hydra/commit/5baca2843a98c222006b27b20e7e6392421ecad8)):
235160

@@ -240,10 +165,6 @@ If this pull request
240165
configuration items that conform to this endpoint as seen here:
241166
https://datatracker.ietf.org/doc/html/rfc8414
242167

243-
* Autoconfigure kratos-changefeed ([d92dabe](https://github.com/ory/hydra/commit/d92dabedf2f55d8b74f5898c987c3e6712fb0b16)):
244-
245-
GitOrigin-RevId: 8e684d3c1ed528798c0c81cc4330858c54a39acf
246-
247168
* **changelog-oel:** Add `hydra debug challenge` command ([a94662f](https://github.com/ory/hydra/commit/a94662f1edc49e662a5e1818dbfd4cac15bd9ead)):
248169

249170
GitOrigin-RevId: 793cf3327696465ea89fdfcf078f26594832a666
@@ -252,18 +173,10 @@ If this pull request
252173

253174
GitOrigin-RevId: 1a115d9e2055bbf9a0bb4ecf7c6a266b2b70a8cd
254175

255-
* **changelog-oel:** Choose identity schema in self-service registration and login flows ([a398b64](https://github.com/ory/hydra/commit/a398b6444bff9476b2768e9e5f840bcf73fff3a6)):
256-
257-
GitOrigin-RevId: 8d6ee03cc8181d3277100a4b7412a3a113799964
258-
259176
* **changelog:** Graceful refresh count limit ([470713d](https://github.com/ory/hydra/commit/470713da36862745ca0222c284e0692fa40559ae)):
260177

261178
GitOrigin-RevId: 7f8bf5fee8b06490f888590054d2dcd2f1cf2cba
262179

263-
* **changelog:** Migrate http router to stdlib router ([a147e3b](https://github.com/ory/hydra/commit/a147e3b64007a3c7b2c5dd0351321c1aa92d5b70)):
264-
265-
GitOrigin-RevId: ebd7ec330a4f7b9826cb70ba36ba2f727ea64c96
266-
267180
* Implement RFC 8628 ([#3912](https://github.com/ory/hydra/issues/3912)) ([5215d24](https://github.com/ory/hydra/commit/5215d2482adc6328f6ed78ac7799f1f5243d1e7f)), closes [#3851](https://github.com/ory/hydra/issues/3851) [#3252](https://github.com/ory/hydra/issues/3252) [#3230](https://github.com/ory/hydra/issues/3230) [#2416](https://github.com/ory/hydra/issues/2416):
268181

269182
This patch introduces the OAuth 2.0 Device Authorization Grant to Ory
@@ -314,10 +227,6 @@ If this pull request
314227

315228
GitOrigin-RevId: dbb48d171fad1f9b4fd31385f0ef4fb01e39e823
316229

317-
* Move config testhelpers to ory/x ([3a4ba08](https://github.com/ory/hydra/commit/3a4ba084c74cf49a521856f150a8a2c6f3c1aa25)):
318-
319-
GitOrigin-RevId: fd484445e9715760231f7f86ec212d094e826377
320-
321230
* Revoke Kratos session asynchronously ([#3936](https://github.com/ory/hydra/issues/3936)) ([a0e7ee2](https://github.com/ory/hydra/commit/a0e7ee29298d4f882a7d471e0601b01c6848c40d)):
322231

323232
This change makes the session revocation in Kratos async to improve
@@ -397,18 +306,10 @@ If this pull request
397306
POST admin/oauth2/auth/sessions/consent?consent_challenge_id=G_TIM3XABG14UwIgDoT1DRfipjhC1uix
398307
```
399308

400-
* Use stdlib HTTP router in Kratos ([8f81931](https://github.com/ory/hydra/commit/8f8193179a39dc142d502fbc559891ffa0385ed8)):
401-
402-
GitOrigin-RevId: 799513e99acbf43a05fe3113ffda45d2fff2a9e0
403-
404309
* Use vendored jackson ([a0a9062](https://github.com/ory/hydra/commit/a0a906211bce4ced3e1f4324eb9d287ef10892a6)):
405310

406311
GitOrigin-RevId: 591238768218ba2b5af93f91ac7e16f4c170da5b
407312

408-
* Use vendored ory/x ([6581e01](https://github.com/ory/hydra/commit/6581e01679b2e146433061cbaaebb80a0e3905b5)):
409-
410-
GitOrigin-RevId: 994f3b754946ca5b2bd1bab0fe20532f5d5ab62f
411-
412313

413314
### Performance Improvements
414315

@@ -419,43 +320,8 @@ If this pull request
419320

420321
### Tests
421322

422-
* Add golangci-lint config and GHA ([1209de7](https://github.com/ory/hydra/commit/1209de78736c6730fa84cbf4e7046535aeba094f)):
423-
424-
GitOrigin-RevId: eb14c9f38e2b98d11a78ee0b90fd8f4f689abd3d
425-
426-
* **hydra:** Add snapshots for login & consent requests ([687cfae](https://github.com/ory/hydra/commit/687cfae2092b90bcde11b0976b3f944bc8bb9a4a)):
427-
428-
GitOrigin-RevId: 47d041cf207af6c3e9e21bf3016e5ea0cf044344
429-
430-
* **hydra:** Clean oauth2 session setup ([699e382](https://github.com/ory/hydra/commit/699e38238220f857148b503dfb96d9b057bb4583)):
431-
432-
GitOrigin-RevId: e05097c7439096cf40fdcf059b3396970b2f1219
433-
434-
* **hydra:** Clean up some helpers ([7840b0e](https://github.com/ory/hydra/commit/7840b0e0aade3b8fac6f1677a75b192e9c094b23)):
435-
436-
GitOrigin-RevId: 2b93dfbc4c27602a6ad053ccd0f25962f600419f
437-
438-
* **hydra:** Convert custom JWT claim tests to table ([8391d1b](https://github.com/ory/hydra/commit/8391d1bc57a85420f50c2e0b856a509b6784963d)):
439-
440-
GitOrigin-RevId: c0114d299bdec370104e8ad0b3042d3a3c045bb1
441-
442-
* **hydra:** New and better e2e go tests ([aefe5e2](https://github.com/ory/hydra/commit/aefe5e2663608ec945dc49be466d48c0d43810f2)):
443-
444-
GitOrigin-RevId: 23a73e451286556fb6b0072c5b348eee137f1310
445-
446-
* **hydra:** Refactor consent handler tests ([4d61925](https://github.com/ory/hydra/commit/4d6192599dc4f1020e8c5418398c6a85820c74cb)):
447-
448-
GitOrigin-RevId: 77753f8e0018eaef2bc17b73d456de5b7b0585b1
449-
450323
* Parallelize and improve ([#3989](https://github.com/ory/hydra/issues/3989)) ([a47e395](https://github.com/ory/hydra/commit/a47e39513f1f08076849f77517977abffa195364))
451324

452-
### Unclassified
453-
454-
* Merge 3834fab8c161a7dc98d43f32acf8efd9e6e95352 into 4dae0f4a8785eb36d8dbb27137f6b924c1e0f0b5 ([dc84053](https://github.com/ory/hydra/commit/dc840535c19d58caf130966e00d3d2fe9f3eb577)):
455-
456-
GitOrigin-RevId: 0c2dcaa065b64d2aafbcfd49c79363a214c5b2aa
457-
458-
459325

460326
# [2.3.0](https://github.com/ory/hydra/compare/v2.2.0...v2.3.0) (2025-01-17)
461327

consent/handler.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ package consent
55

66
import (
77
"cmp"
8-
"context"
98
"encoding/json"
109
"net/http"
1110
"net/url"
@@ -1129,7 +1128,7 @@ func (h *Handler) acceptUserCodeRequest(w http.ResponseWriter, r *http.Request)
11291128
}
11301129

11311130
f.RequestURL = reqURL.String()
1132-
if err := h.r.ConsentManager().HandleDeviceUserAuthRequest(ctx, f, &p); err != nil {
1131+
if err := f.HandleDeviceUserAuthRequest(&p); err != nil {
11331132
h.r.Writer().WriteError(w, r, err)
11341133
return
11351134
}
@@ -1151,12 +1150,3 @@ func (h *Handler) acceptUserCodeRequest(w http.ResponseWriter, r *http.Request)
11511150
RedirectTo: urlx.SetQuery(ru, url.Values{"device_verifier": {verifier}, "client_id": {userCodeRequest.GetClient().GetID()}}).String(),
11521151
})
11531152
}
1154-
1155-
func (h *Handler) decodeFlowWithClient(ctx context.Context, challenge string, opts ...flow.CodecOption) (*flow.Flow, error) {
1156-
f, err := flow.Decode[flow.Flow](ctx, h.r.FlowCipher(), challenge, opts...)
1157-
if err != nil {
1158-
return nil, err
1159-
}
1160-
1161-
return f, nil
1162-
}

consent/handler_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,12 @@ func TestAcceptCodeDeviceRequest(t *testing.T) {
277277

278278
cl := &client.Client{ID: "client"}
279279
require.NoError(t, reg.ClientManager().CreateClient(t.Context(), cl))
280-
f, err := reg.ConsentManager().CreateDeviceUserAuthRequest(t.Context(), &flow.DeviceUserAuthRequest{
280+
f := flow.NewDeviceFlow(&flow.DeviceUserAuthRequest{
281281
Client: cl,
282282
RequestURL: requestURL,
283283
RequestedAt: time.Now(),
284284
})
285-
require.NoError(t, err)
285+
f.NID = reg.Networker().NetworkID(t.Context())
286286
challenge, err := f.ToDeviceChallenge(t.Context(), reg)
287287
require.NoError(t, err)
288288

consent/manager.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ type (
5555
RejectLogoutRequest(ctx context.Context, challenge string) error
5656
VerifyAndInvalidateLogoutRequest(ctx context.Context, verifier string) (*flow.LogoutRequest, error)
5757

58-
CreateDeviceUserAuthRequest(ctx context.Context, req *flow.DeviceUserAuthRequest) (*flow.Flow, error)
59-
HandleDeviceUserAuthRequest(ctx context.Context, f *flow.Flow, r *flow.HandledDeviceUserAuthRequest) error
6058
VerifyAndInvalidateDeviceUserAuthRequest(ctx context.Context, verifier string) (*flow.HandledDeviceUserAuthRequest, error)
6159

6260
NetworkID(ctx context.Context) uuid.UUID

consent/strategy_default.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,22 +1246,22 @@ func (s *DefaultStrategy) forwardDeviceRequest(ctx context.Context, w http.Respo
12461246
q = caseInsensitiveFilterParam(q, "user_code")
12471247
iu.RawQuery = q.Encode()
12481248

1249-
f, err := s.r.ConsentManager().CreateDeviceUserAuthRequest(ctx,
1250-
&flow.DeviceUserAuthRequest{
1251-
ID: challenge,
1252-
Verifier: verifier,
1253-
CSRF: csrf,
1254-
RequestURL: iu.String(),
1255-
RequestedAt: time.Now().Truncate(time.Second).UTC(),
1256-
})
1257-
if err != nil {
1258-
return err
1249+
f := &flow.Flow{
1250+
DeviceChallengeID: sqlxx.NullString(challenge),
1251+
RequestURL: iu.String(),
1252+
DeviceVerifier: sqlxx.NullString(verifier),
1253+
DeviceCSRF: sqlxx.NullString(csrf),
1254+
RequestedAt: time.Now().Truncate(time.Second).UTC(),
1255+
DeviceWasUsed: sqlxx.NullBool{Bool: false, Valid: true},
1256+
State: flow.DeviceFlowStateInitialized,
1257+
NID: s.r.Networker().NetworkID(ctx),
12591258
}
12601259

12611260
encodedFlow, err := f.ToDeviceChallenge(ctx, s.r)
12621261
if err != nil {
12631262
return err
12641263
}
1264+
12651265
store, err := s.r.CookieStore(ctx)
12661266
if err != nil {
12671267
return err

consent/test/manager_test_helpers.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,8 @@ func ManagerTests(deps Deps, m consent.Manager, clientManager client.Manager, fo
459459
_, err := flow.DecodeFromDeviceChallenge(ctx, deps, deviceChallenge)
460460
require.Error(t, err)
461461

462-
f, err = m.CreateDeviceUserAuthRequest(ctx, c)
463-
require.NoError(t, err)
462+
f = flow.NewDeviceFlow(c)
463+
f.NID = deps.Networker().NetworkID(ctx)
464464

465465
deviceChallenge = x.Must(f.ToDeviceChallenge(ctx, deps))
466466

@@ -469,7 +469,7 @@ func ManagerTests(deps Deps, m consent.Manager, clientManager client.Manager, fo
469469
assert.False(t, got1.DeviceWasUsed.Bool)
470470
compareDeviceRequestFlow(t, c, got1)
471471

472-
require.NoError(t, m.HandleDeviceUserAuthRequest(ctx, f, h))
472+
require.NoError(t, f.HandleDeviceUserAuthRequest(h))
473473
compareDeviceRequestFlow(t, c, f)
474474

475475
for _, key := range []string{"1", "2", "3", "4", "5", "6", "7"} {
@@ -479,8 +479,8 @@ func ManagerTests(deps Deps, m consent.Manager, clientManager client.Manager, fo
479479
_, err := flow.DecodeFromDeviceChallenge(ctx, deps, deviceChallenge)
480480
require.Error(t, err)
481481

482-
f, err = m.CreateDeviceUserAuthRequest(ctx, c)
483-
require.NoError(t, err)
482+
f = flow.NewDeviceFlow(c)
483+
f.NID = deps.Networker().NetworkID(ctx)
484484

485485
deviceChallenge = x.Must(f.ToDeviceChallenge(ctx, deps))
486486
challenges = append(challenges, deviceChallenge)
@@ -490,7 +490,7 @@ func ManagerTests(deps Deps, m consent.Manager, clientManager client.Manager, fo
490490
assert.False(t, got1.DeviceWasUsed.Bool)
491491
compareDeviceRequestFlow(t, c, got1)
492492

493-
require.NoError(t, m.HandleDeviceUserAuthRequest(ctx, f, h))
493+
require.NoError(t, f.HandleDeviceUserAuthRequest(h))
494494
compareDeviceRequestFlow(t, c, f)
495495
}
496496

0 commit comments

Comments
 (0)