Skip to content

Commit

Permalink
doc(ember-simple-auth): start writing a migration guide
Browse files Browse the repository at this point in the history
  • Loading branch information
BobrImperator committed Dec 29, 2024
1 parent ca8e532 commit aec17dd
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions guides/upgrade-to-v7.md
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`;
}
```

0 comments on commit aec17dd

Please sign in to comment.