Message from JavaScript discussions

July 2018

— Https://developers.caffeina.com/clean-code-saves-devs-the-caffeina-approach-to-reactjs-1b56ad15aa64?source=user_profile---------2-------------------&gi=f61ab00635de

Message permanent page

— 

Https://github.com/vuejs/vuex/blob/dev/examples/shopping-cart/store/modules/products.js#L13
what is the { commit } means there? is that paramater? why it has {}?

— Destructuring

— It's the same as:

getAllProducts(x) {
var commit = x.commit;
delete x;
// ...

— 

function doSomething({ foo }) {
return foo;
}

var myObj = { foo: 'bar' };
doSomething(myObj); // 'bar'

Message permanent page

— This works the same:

function doSomething(obj) {
return obj.foo;
}

— I see, thank you

— Guys is it safe approch to send jwt as a query parameter?
for oauth2 authentication i am redirecting user from app to oauth page. then i am sending acess token to server. server verifies user and redirects to client with jwt in url as query parameter

Message permanent page

— Yes, you can use jwt anywhere, the only security concern is generally: WHAT data is stored in the token

Message permanent page

— Because remember: the user can see the data

— Just storing user id

— Good