Comments (9)
This is something I can change in our client builder type mapping file. I will look into fixing it.
from fusionauth-typescript-client.
I am attempting to register a user with data. But the data is always empty. I suspect this may be because the data is a Map type. Same thing if I try to use the updateUser
, patchUser
API.
import { FusionAuthClient } from '@fusionauth/typescript-client'
const client = new FusionAuthClient(
'xxxx',
'http://localhost:9011'
)
const main = async () => {
try {
const res = await client.register(undefined, {
user: {
username: 'bbbwer',
password: 'rqergeq34aL',
data: new Map([
['aaa', 'one'],
['bb', 'eee'],
['displayName', 'zERwje']
])
},
registration: {
applicationId: '3149641a-81d8-4202-9715-7d5367ca94f1',
}
})
console.warn('res', res)
} catch (error) {
console.warn('error', JSON.stringify(error, null, 2))
}
}
main()
If I run the code. response is:
res ClientResponse {
statusCode: 200,
response: {
registration: {
applicationId: '3149641a-81d8-4202-9715-7d5367ca94f1',
id: '0e29262e-fb33-4b13-8498-eccd22141f18',
insertInstant: 1584104747639,
usernameStatus: 'ACTIVE',
verified: true
},
user: {
active: true,
id: '7abf7a10-13eb-4f26-8cb2-52338fdc7421',
insertInstant: 1584104747566,
passwordChangeRequired: false,
passwordLastUpdateInstant: 1584104747601,
tenantId: '3e75863b-17bd-712f-22c6-d884ba501412',
twoFactorDelivery: 'None',
twoFactorEnabled: false,
username: 'bbbwer',
usernameStatus: 'ACTIVE',
verified: true
}
}
}
There is no data field.
from fusionauth-typescript-client.
@han4wluc try using a normal object instead of a Map
, e.g.
{
aaa: 'one',
bb: 'eee',
displayName: 'zERwje',
}
from fusionauth-typescript-client.
@han4wluc try using a normal object instead of a
Map
, e.g.{ aaa: 'one', bb: 'eee', displayName: 'zERwje', }
Yes, I have tried, but this way I get a type error.
from fusionauth-typescript-client.
have you tried suppressing the error with @ts-ignore
? if not, I would check to see if that works; that type error is incorrect because the Map
type is being used incorrectly.
from fusionauth-typescript-client.
have you tried suppressing the error with
@ts-ignore
? if not, I would check to see if that works; that type error is incorrect because theMap
type is being used incorrectly.
Yes, it works with @ts-ignore
. Thank you. I will use this workaround for now.
from fusionauth-typescript-client.
Thanks @rintaun for the assist!
@tyduptyler13 Is this something we can incorporate into our client library to make this work a bit better?
from fusionauth-typescript-client.
Published the change in 1.15.8
. Let me know if you have any problems.
from fusionauth-typescript-client.
@tyduptyler13 is there a particular reason for the choice to use a custom ObjectMap<K,T>
type over the built-in Record<K,T>
? It looks like its doing the same thing
from fusionauth-typescript-client.
Related Issues (20)
- connection refused (`ECONNREFUSED`) when it tries to register and create a user HOT 2
- Strongly typed `fieldErrors` and `generalErrors` HOT 1
- UpdateUser Changes the Password Unexpectedly HOT 2
- patchRegistration not working as intended HOT 3
- SDK method to return current access token or refresh it if expired HOT 4
- ClientResponse `exception` key should be defined as `Errors` type instead of `Error`
- retrieveUserByX does not allow specification of a tenant id HOT 5
- Client and API Documentation don't align - searchEntityTypes HOT 2
- client.logout("refreshtokien here") dont work HOT 2
- Issue with domain sync HOT 5
- EventType includes unused types HOT 4
- Missing /oauth2/device_authorize endpoint
- Missing "Complete the Device Authorization Grant Request" method call HOT 1
- searchUsersByIds Badly formats the query, resulting in an error HOT 1
- Add a default timeout that isn't 0 for requests
- Sveltkit or authJS examples HOT 7
- Unexpected Response for `FusionAuthClient#searchUsersByQuery` When Using `sortFields`. HOT 3
- Receiving punycode deprecation warning HOT 1
- Patch user request types do not allow for removing a user property
- Misguided documentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fusionauth-typescript-client.