Quantcast
Channel: User Alexander Staroselsky - Stack Overflow
Browsing all 40 articles
Browse latest View live

Comment by Alexander Staroselsky on Unknown authentication strategy Passport js

You could even try just registering a dummy route with passport_authorised.authenticate('admin-rule' in the same file as where the JwtStrategy is setup and see if the error still happens (commenting...

View Article



Comment by Alexander Staroselsky on empty Object when accessing it from...

This is called "stale closure", for changes to be picked up, you would need to add the state variables such as isWinnerList to be part of the dependency list. Can move the updateScore portion to a new...

View Article

Comment by Alexander Staroselsky on Why is Mocha ignoring asynchronous...

Are you stubbing executeRequest with sinon in these tests?

View Article

Comment by Alexander Staroselsky on Best way to move data between two pages...

Keep in mind, often form submissions are "handled" in endpoints because either you are using a "traditional" form submit and are getting data from formData or the submission needs to be entered into a...

View Article

Comment by Alexander Staroselsky on Passing params from my frontend to...

What is the value of actor, at the time actorQuery runs? Does it have a valid/expected value?

View Article


Comment by Alexander Staroselsky on NextJS application error in production:...

What does console.log(user) or console.log(user.upvoted) log inside the useEffect? Are you defaulting user.upvoted to an empty array in your context initial state?

View Article

Comment by Alexander Staroselsky on Unit test with jest, test tap and map

How would you normally check in tests whether functions/methods have been called and what they were called with?

View Article

Comment by Alexander Staroselsky on Is there an easy way to persist...

Have you considered updating CanActivate to return a promise or observable (that async checks the api endpoint) and then as a side effect update the behavior subject?

View Article


Comment by Alexander Staroselsky on Accessing the updated state in useEffect...

@codedor Note sure what you mean exactly. Do you mean how to know whether steamId has a value? In the component rendering, you can use conditional rendering to only render something based on the...

View Article


Comment by Alexander Staroselsky on How to use token authorization with axios...

Can you share the successful request from insomnia as a curl?

View Article

Comment by Alexander Staroselsky on Shopify API request

That code will expose your api password to the world. This doesn’t seem a request they should happen client side.

View Article

Answer by Alexander Staroselsky for Svelte can't find .ScrollTop of a variable

A couple of issues, the first is that is scrollTop with a lowercase “s”, the other is that the element does not bind immediately so if you are putting this statement at the top level of the component...

View Article

Answer by Alexander Staroselsky for How can I store my JWT Token in...

You are expecting response.data to be an object. In that case update your API handler to return property token in an object:exports.login = async (req,res) =>{ const b64auth =...

View Article


Answer by Alexander Staroselsky for Getting Property 'height' does not exist...

You can use a generic type with useRef to something that has getBoundingClientRect as a valid method, such as HTMLElement or HTMLDivElement:const divRef = useRef<HTMLDivElement>(null);That should...

View Article

Answer by Alexander Staroselsky for react axios cros body empty

GET requests with axios don’t support a body, change it to a POST:rooter.post('/login', async (req, res) => { console.log('*** req.body:',...

View Article


Answer by Alexander Staroselsky for onChange event is not being triggered in...

Try using event onInput instead:<Form.Control className="auth-input" type='text' placeholder="Search..." onInput={(e) => setSearch(e.target.value)} />

View Article

Answer by Alexander Staroselsky for Typescript say variable can be null even...

What about instead using a default similar to what you have with delay:pollUrl: function ( httpClient, url: string, maxIterations = 25, delay = 600 ): Promise<any> { return...

View Article


Answer by Alexander Staroselsky for Property proxyConfig is not allowed. Angular

Try instead putting the configuration at architect.serve.options rather than architect.build.options.https://angular.io/guide/build#proxying-to-a-backend-server

View Article

Answer by Alexander Staroselsky for React Axios Uncaught (in promise)

Update your interceptor to target response.status instead of response.data.status. Per the response schemaresponse.data will provide you the numeric status code that you can do you conditional checks...

View Article

Answer by Alexander Staroselsky for Jest test case is failing in nestjs

Update the assertion to be the following:expect(repository.findOne).toHaveBeenCalledWith({ id: "1" });This will match what how the code uses id to call certificateRepository.findOne.

View Article
Browsing all 40 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>