-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2892 from mainmatter/test-esa-via-link
chore(deps): specify ember-simple-auth as a link for test-apps
- Loading branch information
Showing
7 changed files
with
49 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
### tl;dr | ||
|
||
Release 7.0.0 doesn't contain any new features and the API haven't really changed. | ||
It focuses on housekeeping, modernizing the codebase and introducing Typescript to our library. | ||
The biggest change was getting rid of as much "classic" Ember syntax as possible and get onto ES6 classes. | ||
|
||
### Extending ember-simple-auth's classes | ||
|
||
Most if not all of the public API is ES6 classes, as a result you'll have to change how ESA's classes are extended in your codebases. | ||
Here's an example based on the OAuth2PasswordGrant authenticator. | ||
|
||
Old | ||
|
||
```js | ||
import OAuth2PasswordGrant from 'ember-simple-auth/authenticators/oauth2-password-grant'; | ||
import config from '../config/environment'; | ||
|
||
export default OAuth2PasswordGrant.extend({ | ||
serverTokenEndpoint: `${config.apiHost}/token`, | ||
serverTokenRevocationEndpoint: `${config.apiHost}/revoke`, | ||
}); | ||
``` | ||
|
||
New | ||
|
||
```js | ||
import OAuth2PasswordGrant from 'ember-simple-auth/authenticators/oauth2-password-grant'; | ||
import config from '../config/environment'; | ||
|
||
export default class OAuth2 extends OAuth2PasswordGrant { | ||
serverTokenEndpoint = `${config.apiHost}/token`; | ||
serverTokenRevocationEndpoint = `${config.apiHost}/revoke`; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import OAuth2PasswordGrant from 'ember-simple-auth/authenticators/oauth2-password-grant'; | ||
import config from '../config/environment'; | ||
|
||
export default OAuth2PasswordGrant.extend({ | ||
serverTokenEndpoint: `${config.apiHost}/token`, | ||
serverTokenRevocationEndpoint: `${config.apiHost}/revoke`, | ||
}); | ||
export default class OAuth2 extends OAuth2PasswordGrant { | ||
serverTokenEndpoint = `${config.apiHost}/token`; | ||
serverTokenRevocationEndpoint = `${config.apiHost}/revoke`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import Controller from '@ember/controller'; | ||
import { inject as service } from '@ember/service'; | ||
|
||
export default Controller.extend({ | ||
router: service(), | ||
|
||
actions: { | ||
transitionToLoginRoute() { | ||
this.transitionToRoute('login'); | ||
this.router.transitionTo('login'); | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.