Class: Aikotoba::SessionsController

Inherits:
ApplicationController show all
Includes:
Authenticatable
Defined in:
app/controllers/aikotoba/sessions_controller.rb

Instance Method Summary collapse

Methods included from Authenticatable

#aikotoba_authenticate_by_session, #aikotoba_current_account, #aikotoba_sign_in, #aikotoba_sign_out

Methods inherited from ApplicationController

#aikotoba_controller?

Methods included from EnabledFeatureCheckable

#confirmable?, #lockable?, #recoverable?, #registerable?

Instance Method Details

#createObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/aikotoba/sessions_controller.rb', line 12

def create
  @account = (session_params.to_h.symbolize_keys)
  if @account
    
    (@account)
    
    redirect_to , notice: successed_message
  else
    
    @account = ({email: "", password: ""})
    flash[:alert] = failed_message
    render :new, status: :unprocessable_entity
  end
end

#destroyObject



27
28
29
30
# File 'app/controllers/aikotoba/sessions_controller.rb', line 27

def destroy
  aikotoba_sign_out if 
  redirect_to after_sign_out_path, notice: signed_out_message
end

#newObject



7
8
9
10
# File 'app/controllers/aikotoba/sessions_controller.rb', line 7

def new
  return redirect_to  if 
  @account = ({email: "", password: ""})
end