Class: GrpcAuth::AuthController

Inherits:
ApplicationController show all
Defined in:
app/controllers/grpc_auth/auth_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#stub

Instance Method Details

#authObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/controllers/grpc_auth/auth_controller.rb', line 14

def auth
  unless verify_rucaptcha?
    flash[:alert] = "验证码出错"
    redirect_to main_app.root_path and return
  end

   = params[:login]
  psd = params[:password]
  hsh = gauth(,psd)
  if hsh == false
    redirect_to  , alert: "用户信息有误" and return
  else
    name = hsh.RealName
    groups = hsh.Tags
    session[:login] = 
    session[:realname] = name
    session[:groups] = groups
    redirect_to main_app.root_path and return
  end
end

#loginObject



5
6
# File 'app/controllers/grpc_auth/auth_controller.rb', line 5

def 
end

#logoutObject



8
9
10
11
12
# File 'app/controllers/grpc_auth/auth_controller.rb', line 8

def logout
  flash[:notice]="你已经登出"
  reset_session
  redirect_to  main_app.root_path
end