# Encountered a resource object with an undefined type

**URL:** <https://discuss.emberjs.com/t/encountered-a-resource-object-with-an-undefined-type/11519>\
**Category:** Ember Data\
**Created:** [September 4, 2016, 7:00pm UTC](https://discuss.emberjs.com/t/encountered-a-resource-object-with-an-undefined-type/11519 "2016-09-04T19:00:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![silva](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@silva](https://discuss.emberjs.com/u/silva)\
**Post date:** [September 4, 2016, 7:00pm UTC](https://discuss.emberjs.com/t/encountered-a-resource-object-with-an-undefined-type/11519/1 "2016-09-04T19:00:24Z")

</div>

I’m trying to implement authentication after the user creation in an ember/rails-api I’m able to correctly add the user to the database, but I’m getting this in the console:

```auto
ember.debug.js:31321 Error: Assertion Failed: Encountered a resource object with an undefined type (resolved resource using ember-app@serializer:user:)

```

I do get back the correct json with my info:

```auto
{"data":{"token":"ezUR_NTxy7STEiiFhEx3","email":"test@email.com"}}

```

when I run in the console:

```auto
newUser.save()

```

```auto
Class { __ember1473012953664: "ember539",__ ember_meta__: Meta}
  __ember1473012953664: "ember539"
  __ember_meta__ : Meta
  __proto__ : Class
  __ember1473012953664: "ember113"
  __ember_meta__ : Meta
  _super: ROOT()
  catch: ()
  constructor: (subclass of Ember.ObjectProxy)
  content: (...)
  finally: ()
  isFulfilled: false
  isPending: ComputedProperty 
  isRejected: false
  isSettled: ComputedProperty
  promise: ComputedProperty
  reason: null
  then: ()
  __proto__ : Class

```

isFulfilled is false… so the authenticate method is not even called:

```auto
newUser.save().then(function(response) {
        this.get('session').authenticate('authenticator:devise', newUser.get('email'), newUser.get('password')).catch((reason) => {
          this.set('errorMessage', reason.error);
        });
      });

```

Any chance someone could give me a hand?? Thanks in advance!!
