Class: GrpcAuth::AuthController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- GrpcAuth::AuthController
- Defined in:
- app/controllers/grpc_auth/auth_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#auth ⇒ Object
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 login = params[:login] psd = params[:password] hsh = gauth(login,psd) if hsh == false redirect_to login_path , alert: "用户信息有误" and return else name = hsh.RealName groups = hsh.Tags session[:login] = login session[:realname] = name session[:groups] = groups redirect_to main_app.root_path and return end end |
#login ⇒ Object
5 6 |
# File 'app/controllers/grpc_auth/auth_controller.rb', line 5 def login end |
#logout ⇒ Object
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 |