@@ -119,6 +119,7 @@ impl Api {
119
119
let transaction_id = self
120
120
. state
121
121
. passage_client
122
+ . auth
122
123
. create_register_transaction ( user_id. clone ( ) , req. 0 . email . clone ( ) )
123
124
. await
124
125
. map_err ( |e| {
@@ -155,6 +156,7 @@ impl Api {
155
156
let transaction_id = self
156
157
. state
157
158
. passage_client
159
+ . auth
158
160
. create_authenticate_transaction ( user_id)
159
161
. await
160
162
. map_err ( |e| match e {
@@ -180,7 +182,7 @@ impl Api {
180
182
#[ oai( path = "/auth/verify" , method = "post" ) ]
181
183
async fn verify_nonce ( & self , req : Json < VerifyRequest > ) -> poem:: Result < Json < VerifyResponse > > {
182
184
// Verify the nonce using the Passage SDK
183
- match self . state . passage_client . verify_nonce ( req. 0 . nonce ) . await {
185
+ match self . state . passage_client . auth . verify_nonce ( req. 0 . nonce ) . await {
184
186
Ok ( user_id) => {
185
187
// Find the user in the database and set the auth token
186
188
let mut users = self . state . users . lock ( ) . await ;
@@ -225,6 +227,7 @@ impl Api {
225
227
let transaction_id = self
226
228
. state
227
229
. passage_client
230
+ . auth
228
231
. create_register_transaction ( user. id . clone ( ) , user. email . clone ( ) )
229
232
. await
230
233
. map_err ( |e| {
@@ -261,7 +264,8 @@ impl Api {
261
264
let passkeys = self
262
265
. state
263
266
. passage_client
264
- . get_devices ( user. id . clone ( ) )
267
+ . user
268
+ . list_devices ( user. id . clone ( ) )
265
269
. await
266
270
. map ( |devices| {
267
271
devices
@@ -306,6 +310,7 @@ impl Api {
306
310
// Revoke the passkey device using the Passage SDK
307
311
self . state
308
312
. passage_client
313
+ . user
309
314
. revoke_device ( user. id . clone ( ) , req. 0 . passkey_id . clone ( ) )
310
315
. await
311
316
. map_err ( |e| {
0 commit comments