github.com/manicqin/nomad@v0.9.5/ui/app/adapters/token.js (about)

     1  import { inject as service } from '@ember/service';
     2  import { default as ApplicationAdapter, namespace } from './application';
     3  
     4  export default ApplicationAdapter.extend({
     5    store: service(),
     6  
     7    namespace: namespace + '/acl',
     8  
     9    findSelf() {
    10      return this.ajax(`${this.buildURL()}/token/self`, 'GET').then(token => {
    11        const store = this.store;
    12        store.pushPayload('token', {
    13          tokens: [token],
    14        });
    15  
    16        return store.peekRecord('token', store.normalize('token', token).data.id);
    17      });
    18    },
    19  });