I had a question regarding best practice when it comes to building a global utility class in EmberJS when the class will exhibit user-specific behavior.
Is a Util the best option? Should I be using services and somehow "initialize" this service on a confirmed authentication? My end goal is to use this class from almost every route/template/component in my application.
How chill are authentication payloads? Is it OK to send crumbs of user specific information information in the authentication payload in addition to any tokens?
The best choice is using services.
They are :
Ember.Object
Is a Util the best option?
No. Services is best option. You can initialize it after successful authentication hook of ESA. And it could be injected everywhere
How chill are authentication payloads?
You can send anything. Your authenticator
is responsible to process it. The payload is saved in data.authenticated
object in ESA session service