'Register a device for a user.
This is called after the user\'s credentials have been validated, but
before the access token has been issued.
Args:
(str) user_id: full canonical @user:id
(object) login_submission: dictionary supplied to /login call, from
which we pull device_id and initial_device_name
Returns:
defer.Deferred: (str) device_id'

def _register_device(self, user_id, login_submission):

    device_id = login_submission.get('device_id')
    initial_display_name = login_submission.get('initial_device_display_name')
    return self.device_handler.check_device_registered(user_id, device_id, initial_display_name)
