加入组织
This commit is contained in:
parent
17282083a6
commit
72f5f5b795
|
@ -22,13 +22,17 @@ class SsosController < ApplicationController
|
|||
|
||||
logger.debug @options
|
||||
## 认证
|
||||
login(@options)
|
||||
sso = login(@options)
|
||||
|
||||
logger.debug "login over"
|
||||
## 加入组织
|
||||
@organization = Organization.find(82)
|
||||
unless @organization.org_members.exists?(user_id: sso.user_id)
|
||||
member = OrgMember.new(:user_id => sso.user_id)
|
||||
@organization.org_members << member
|
||||
end
|
||||
|
||||
## 选择性跳转
|
||||
|
||||
redirect_to Organization.find(82)
|
||||
redirect_to @organization
|
||||
rescue => e
|
||||
logger.error e
|
||||
if e.message == "exist user"
|
||||
|
@ -61,6 +65,7 @@ class SsosController < ApplicationController
|
|||
def login(opt)
|
||||
sso = Sso.sync_user(opt)
|
||||
start_user_session(sso.user)
|
||||
sso
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue