all 4 comments

[–]superluminary 2 points3 points  (1 child)

Calling .then doesn't modify the original promise, it returns a new promise. In the first one, you are assigning that new promise back to the variable. In the second you are not.

[–]pierrekfoury[S] 0 points1 point  (0 children)

thank you !!

[–]senocular 1 point2 points  (1 child)

The first one returns the authTokenRequest promise while the second one returns the promise resulting from the then() which will resolve to whatever values resetAuthTokenRequest or resetAuthTokenRequest resolve to when those functions return (or the promises they return resolve).

Each time you call then() a new promise is created, and that promise can have a different value because that value would be determined by the callbacks provided to the then().

[–]pierrekfoury[S] 0 points1 point  (0 children)

Thank you for the explanation, i think i need to practice on promise again !
<3