# Ember Simple Auth: routeIfAlreadyAuthenticated vs routeAfterAuthentication

**URL:** <https://discuss.emberjs.com/t/ember-simple-auth-routeifalreadyauthenticated-vs-routeafterauthentication/14921>\
**Category:** Questions\
**Created:** [June 11, 2018, 7:28am UTC](https://discuss.emberjs.com/t/ember-simple-auth-routeifalreadyauthenticated-vs-routeafterauthentication/14921 "2018-06-11T07:28:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![belgoros](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/belgoros/32/16101_2.png) [@belgoros](https://discuss.emberjs.com/u/belgoros)\
**Post date:** [June 11, 2018, 7:28am UTC](https://discuss.emberjs.com/t/ember-simple-auth-routeifalreadyauthenticated-vs-routeafterauthentication/14921/1 "2018-06-11T07:28:55Z")

</div>

Can anybody explain what is the difference between these 2 methods in Ember Simple Auth:

```auto
routeAfterAuthentication

and

routeIfAlreadyAuthenticated

```

I have 2 apps that have these two parameters defined in `environment.js` and I’d like to know when to use one or another. Thank you.

---

<div class="post-metadata">

**Author:** ![balint](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/balint/32/12521_2.png) [@balint](https://discuss.emberjs.com/u/balint)\
**Post date:** [June 12, 2018, 8:55am UTC](https://discuss.emberjs.com/t/ember-simple-auth-routeifalreadyauthenticated-vs-routeafterauthentication/14921/2 "2018-06-12T08:55:10Z")

</div>

They are two different things:

- `routeAfterAuthentication` is where to transition after a successful login.
- `routeIfAlreadyAuthenticated` is where to go if the user is already authenticated and visits a page which makes no sense to visit if you’re logged in (`login`, `register`, a guest homepage, etc.)

---

<div class="post-metadata">

**Author:** ![belgoros](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/belgoros/32/16101_2.png) [@belgoros](https://discuss.emberjs.com/u/belgoros)\
**Post date:** [June 12, 2018, 9:15am UTC](https://discuss.emberjs.com/t/ember-simple-auth-routeifalreadyauthenticated-vs-routeafterauthentication/14921/3 "2018-06-12T09:15:55Z")

</div>

Hi Balint! Thank you for your response. So following your book, where we have it defined as follows in `environment.js`:

```auto
# environment.js
module.exports = function(environment) {
  let ENV = {
...
 'ember-simple-auth': {
      routeIfAlreadyAuthenticated: 'bands'
    },
...

```

it seems like there is no difference in which one to use, both will make the transition to `bands` route. Right ?

---

<div class="post-metadata">

**Author:** ![balint](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/balint/32/12521_2.png) [@balint](https://discuss.emberjs.com/u/balint)\
**Post date:** [June 12, 2018, 12:22pm UTC](https://discuss.emberjs.com/t/ember-simple-auth-routeifalreadyauthenticated-vs-routeafterauthentication/14921/4 "2018-06-12T12:22:25Z")

</div>

The two config variables have different meanings but in some cases they might overlap, like in the Rock and Roll app. The important thing is to see how they differ.

---

<div class="post-metadata">

**Author:** ![belgoros](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/belgoros/32/16101_2.png) [@belgoros](https://discuss.emberjs.com/u/belgoros)\
**Post date:** [June 12, 2018, 12:34pm UTC](https://discuss.emberjs.com/t/ember-simple-auth-routeifalreadyauthenticated-vs-routeafterauthentication/14921/5 "2018-06-12T12:34:38Z")

</div>

Ok, got it, thank you very much !
