Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// eslint-disable-next-line max-len
import OAuth2PasswordGrant from 'ember-simple-auth/authenticators/oauth2-password-grant';
import ENV from '../config/environment';
const serverTokenPath = '/api/oauth/token';
const serverTokenEndpoint = ENV.apiHost
? ENV.apiHost + serverTokenPath
: serverTokenPath;
export default OAuth2PasswordGrant.extend({
serverTokenEndpoint,
});
import Authenticator from 'ember-simple-auth/authenticators/oauth2-password-grant';
import RSVP from 'rsvp';
import {assign} from '@ember/polyfills';
import {computed} from '@ember/object';
import {isEmpty} from '@ember/utils';
import {run} from '@ember/runloop';
import {inject as service} from '@ember/service';
import {makeArray as wrap} from '@ember/array';
export default Authenticator.extend({
ajax: service(),
session: service(),
config: service(),
ghostPaths: service(),
init() {
this._super(...arguments);
let handler = run.bind(this, () => {
this.onOnline();
});
window.addEventListener('online', handler);
},
serverTokenEndpoint: computed('ghostPaths.apiRoot', function () {
return `${this.get('ghostPaths.apiRoot')}/authentication/token`;
import OAuth2PasswordGrant from 'ember-simple-auth/authenticators/oauth2-password-grant';
import { set } from '@ember/object';
import { inject as service } from '@ember/service';
import config from 'client/config/environment';
export default OAuth2PasswordGrant.extend({
refreshAccessTokens: true,
session: service(),
init() {
this._super(...arguments);
const host = config.kitsu.APIHost || '';
set(this, 'serverTokenEndpoint', `${host}/api/oauth/token`);
set(this, 'serverTokenRevocationEndpoint', `${host}/api/oauth/revoke`);
}
});
import OAuth2PasswordGrant from 'ember-simple-auth/authenticators/oauth2-password-grant';
import config from '../config/environment';
export default OAuth2PasswordGrant.extend({
serverTokenEndpoint: [config.API.host, config.API.namespace, 'auth/local'].join('/')
});
import OAuth2PasswordGrant from 'ember-simple-auth/authenticators/oauth2-password-grant';
export default OAuth2PasswordGrant.extend({
serverTokenEndpoint: 'oauth/token',
serverTokenRevocationEndpoint: 'oauth/revoke',
clientId: '9405fb6b0e59d2997e3c777a22d8f0e617a9f5b36b6565c7579e5be6deb8f7ae'
});
import OAuth2PasswordGrant from 'ember-simple-auth/authenticators/oauth2-password-grant';
export default OAuth2PasswordGrant.extend({
serverTokenEndpoint: '/muffin/token'
});
import OAuth2PasswordGrant from 'ember-simple-auth/authenticators/oauth2-password-grant';
import config from 'front/config/environment';
export default OAuth2PasswordGrant.extend({
serverTokenEndpoint: config.APP.backendHost+'/oauth/v2/token',
clientId: config.APP.oAuth2Client,
sendClientIdAsQueryParam: true,
refreshAccessTokens: true,
makeRequest(url, data, headers = {}) {
data.client_secret = config.APP.oAuth2Secret;
return this._super(url, data, headers);
}
});