mozilla / fxa-auth-server

DEPRECATED - Migrated to https://github.com/mozilla/fxa
Mozilla Public License 2.0
399 stars 121 forks source link

chore(refactor): Refactor the /token endpoint to improve clarity. #2946

Closed rfk closed 5 years ago

rfk commented 5 years ago

Continues https://github.com/mozilla/fxa-auth-server-private/pull/90 in the public repo.

Here's my attempt at a broader refactor of the /token route, as described in https://bugzilla.mozilla.org/show_bug.cgi?id=1531648. There are longer functions, but the control flow is much simpler IMHO and therefore easier to follow.

rfk commented 5 years ago

Updated, with an additional test that failed with the missing await and is passing now that it's present.