@@ -12,7 +12,6 @@ import {execService} from "./exec-service"
12
12
import { normalizeCompositeSignature } from "../normalizers/service/composite-signature"
13
13
import { getDiscoveryService , makeDiscoveryServices } from "../discovery"
14
14
import { getServiceRegistry } from "./exec-service/plugins"
15
- import { isMobile } from "../utils"
16
15
17
16
/**
18
17
* @typedef {import("@onflow/typedefs").CurrentUser } CurrentUser
@@ -160,6 +159,7 @@ const getAuthenticate =
160
159
* @description - Authenticate a user
161
160
* @param {object } [opts] - Options
162
161
* @param {object } [opts.service] - Optional service to use for authentication
162
+ * @param {object } [opts.user] - Optional user object
163
163
* @param {boolean } [opts.redir] - Optional redirect flag
164
164
* @returns
165
165
*/
@@ -189,6 +189,7 @@ const getAuthenticate =
189
189
msg : accountProofData ,
190
190
opts,
191
191
platform,
192
+ user,
192
193
} )
193
194
send ( NAME , SET_CURRENT_USER , await buildUser ( response ) )
194
195
} catch ( error ) {
@@ -224,6 +225,7 @@ const getAuthenticate =
224
225
opts,
225
226
platform,
226
227
execStrategy : discovery ?. execStrategy ,
228
+ user,
227
229
} )
228
230
229
231
send ( NAME , SET_CURRENT_USER , await buildUser ( response ) )
@@ -258,7 +260,7 @@ const normalizePreAuthzResponse = authz => ({
258
260
259
261
const getResolvePreAuthz =
260
262
( { platform} ) =>
261
- authz => {
263
+ ( authz , { user } ) => {
262
264
const resp = normalizePreAuthzResponse ( authz )
263
265
const axs = [ ]
264
266
@@ -275,9 +277,7 @@ const getResolvePreAuthz =
275
277
service : az ,
276
278
msg : signable ,
277
279
platform,
278
- opts : {
279
- initiatedByPreAuthz : true ,
280
- } ,
280
+ user,
281
281
} )
282
282
} ,
283
283
role : {
@@ -319,7 +319,11 @@ const getAuthorization =
319
319
service : preAuthz ,
320
320
msg : preSignable ,
321
321
platform,
322
- } )
322
+ user,
323
+ } ) ,
324
+ {
325
+ user,
326
+ }
323
327
)
324
328
if ( authz ) {
325
329
return {
@@ -339,6 +343,7 @@ const getAuthorization =
339
343
includeOlderJsonRpcCall : true ,
340
344
} ,
341
345
platform,
346
+ user,
342
347
} )
343
348
)
344
349
} ,
@@ -446,6 +451,7 @@ const getSignUserMessage =
446
451
service : signingService ,
447
452
msg : makeSignable ( msg ) ,
448
453
platform,
454
+ user,
449
455
} )
450
456
if ( Array . isArray ( response ) ) {
451
457
return response . map ( compSigs => normalizeCompositeSignature ( compSigs ) )
0 commit comments