Class: UserTemplates::LoginController

Inherits:
Volt::ModelController
  • Object
show all
Defined in:
app/user_templates/controllers/login_controller.rb

Instance Method Summary collapse

Instance Method Details

#do_loginObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/user_templates/controllers/login_controller.rb', line 7

def 
  Volt.(, password).then do
    # Successful login, clear out the form
    self.errors = nil
    self. = ''
    self.password = ''

    go(attrs..or('/'))

    nil
  end.fail do |errors|
    # Login fail
    self.errors = errors
  end
end

#use_username?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'app/user_templates/controllers/login_controller.rb', line 23

def use_username?
  Volt.config.public.try(:auth).try(:use_username)
end