 
     else
       @buildViews()
+
+
+  buildVerifyView: ->
+
+    @container.destroySubViews()
+
+    @codeEntryView = new KDHitEnterInputView
+      type         : 'text'
+      cssClass     : 'verify-pin-input'
+      placeholder  : 'Enter code here'
+      callback     : @bound 'verifyAccount'
+
+    @button    = new KDButtonView
+      title    : 'Verify account'
+      cssClass : 'solid green medium'
+      callback : @bound 'verifyAccount'
+
+    @container.addSubView new KDCustomHTMLView
+      cssClass : 'verify-message'
+      partial  : """
+        <p>Before you can access your VM, we need to verify your account.
+        A verification email should already be in your inbox.
+        If you did not receive it yet, you can request a <cite>new code</cite>.</p>
+      """
+      click    : (event)=>
+
+        return  unless $(event.target).is 'cite'
+
+        KD.remote.api.JUser.verifyByPin resendIfExists: yes, (err)=>
+
+          unless KD.showError err
+
+            @container.addSubView @retryView = new KDCustomHTMLView
+              cssClass : 'error-message warning'
+              partial  : """
+                <p>Email sent, please check your inbox.</p>
+              """
+
+            KD.utils.wait 3000, @retryView.bound 'destroy'
+
+    @container.addSubView @codeEntryView
+    @container.addSubView @button
 
 
   buildViews: (response)->

    @hasError = null


  turnOnMachine: ->

    computeController = KD.getSingleton 'computeController'
    computeController.off  "error-#{@machineId}"

    @emit 'MachineTurnOnStarted'

    methodName   = 'start'
    nextState    = 'Starting'

    if @state in [ NotInitialized, Terminated ]
      methodName = 'build'
      nextState  = 'Building'

    computeController.once "error-#{@machineId}", ({err})=>

      unless err?.code is ComputeController.Error.NotVerified
        @hasError = yes

      @buildViews State: @machine.status.state

    KD.singletons.computeController[methodName] @machine

    @state = nextState
    @buildViews()


  prepareIDE: ->

    KD.getSingleton('computeController').fetchMachines (err, machines) =>
      return KD.showError "Couldn't fetch your VMs"  if err

      m = machine for machine in machines when machine._id is @machine._id

      KD.getSingleton('appManager').tell 'IDE', 'mountMachine', m
      @machine = m
      @setData m

      @emit 'IDEBecameReady', m


  handleNoMachineFound: ->

    {@state} = @getOptions()

    @buildViews()
    @createFooter()
    return @show()


  turnOnMachine: ->

    computeController = KD.getSingleton 'computeController'
    computeController.off  "error-#{@machineId}"

    @emit 'MachineTurnOnStarted'

    methodName   = 'start'
    nextState    = 'Starting'

    if @state in [ NotInitialized, Terminated ]
      methodName = 'build'
      nextState  = 'Building'

    computeController.once "error-#{@machineId}", ({err})=>

      unless err?.code is ComputeController.Error.NotVerified
        @hasError = yes

      @buildViews State: @machine.status.state

    KD.singletons.computeController[methodName] @machine

    @state = nextState
    @buildViews()


  prepareIDE: ->

    KD.getSingleton('computeController').fetchMachines (err, machines) =>
      return KD.showError "Couldn't fetch your VMs"  if err

      m = machine for machine in machines when machine._id is @machine._id

      KD.getSingleton('appManager').tell 'IDE', 'mountMachine', m
      @machine = m
      @setData m

      @emit 'IDEBecameReady', m


  verifyAccount: ->
