Commit Graph

5 Commits

Author SHA1 Message Date
Kevin Ansfield
cb59388c5b 💄🐷 sort-imports eslint rule (#712)
no issue

- adds `eslint-plugin-sort-imports-es6-autofix` dependency
  - implements ESLint's base `sort-imports` rule but has a distinction in that `import {foo} from 'bar';` is considered `multiple` rather than `single`
  - fixes ESLint's autofix behaviour so `eslint --fix` will actually fix the sort order
- updates all unordered import rules by using `eslint --fix`

With the increased number of `import` statements since Ember+ecosystem started moving towards es6 modules I've found it frustrating at times trying to search through randomly ordered import statements. Recently I've been sorting imports manually when I've added new code or touched old code so I thought I'd add an ESLint rule to codify it.
2017-05-29 20:50:03 +02:00
Kevin Ansfield
b68fc53efd use current URI instead of configured blog URI for OAuth redirectURI (#518)
refs https://github.com/TryGhost/Ghost/issues/7907
- rather than forwarding the redirect URI as configured in Ghost we should use the URL that the admin client is currently loaded on when setting the Ghost OAuth `redirectUri` attribute
- fixes issue with the admin app loading inside of the OAuth popup window and not logging in when using https with a registered http redirect uri
2017-02-01 16:15:47 +00:00
Kevin Ansfield
106be90416 🐛 fix oAuth login for blog urls which contain /ghost (#429)
no issue
- use the configured `blogUrl` value rather than using `window.location.href` with a poor regex that was incorrectly matching on domains containing multiple `/ghost` parts such as `http://ghost.local:2368/ghost`
2016-12-03 15:56:51 +07:00
Kevin Ansfield
6c317054c1 Fetch config from endpoint rather than meta tags (#368)
refs TryGhost/Ghost#7628 (issue), refs TryGhost/Ghost#7631 (required)

- update `config` service to fetch from public configuration endpoint
- add `beforeModel` to `application` route to fetch config and pause further processing until the request is complete
- remove `<meta name="env-*">` tags from generated `default.hbs` and internal testing `index.html`
- add mirage config to simulate configuration endpoint and helper to simulate enabled oauth config
- update `ghost-oauth2` torii provider to use auth server URL from server-provided config
2016-10-28 14:07:50 +01:00
Kevin Ansfield
a258e3d881 Ghost.org OAuth support (#278)
issue TryGhost/Ghost#7452, requires TryGhost/Ghost#7451
- use a `ghostOAuth` config flag to switch between the old-style per-install auth and centralized OAuth auth based on config provided by the server
- add OAuth flows for:
  - setup
  - sign-in
  - sign-up
  - re-authenticate
- add custom `oauth-ghost` authenticator to support our custom data structure
- add test helpers to stub successful/failed oauth authentication
- hide change password form if using OAuth (temporary - a way to change password via oauth provider will be added later)
2016-09-30 13:43:40 +02:00