Skip to content

Commit

Permalink
clear auth token
Browse files Browse the repository at this point in the history
  • Loading branch information
yigefaxian committed Sep 12, 2024
1 parent cd27649 commit 2ea9ea8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GIT

GIT
remote: https://github.com/work-design/rails_com.git
revision: 099a8f603e34460d155cd22a549cd5964afc0996
revision: b8beacdab205a463608efd0d385cf8554633e85b
specs:
rails_com (1.3.0)
acme-client
Expand All @@ -30,7 +30,7 @@ GIT

GIT
remote: https://github.com/work-design/rails_design.git
revision: d4ea28351196b499f4ac432a16ef70e2ddcd666b
revision: dbc2bf1e5b1a0ea84db5149700802d97f7a390a6
specs:
rails_design (0.0.1)
rails
Expand All @@ -44,7 +44,7 @@ GIT

GIT
remote: https://github.com/work-design/rails_org.git
revision: 9fb948a36583bb5cc85855d527dc4086fea5d81c
revision: 56dd25e03230a13b39736d5000a8cf82e7606aa5
specs:
rails_org (0.0.1)
rails_com
Expand Down
6 changes: 6 additions & 0 deletions app/controllers/wechat/wechat_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Wechat
class WechatController < BaseController
skip_before_action :verify_authenticity_token if whether_filter(:verify_authenticity_token)
before_action :clear_auth_token, only: [:login]
layout 'auth/base', only: [:login]

def auth
Expand Down Expand Up @@ -103,5 +104,10 @@ def login_by_wechat_user(oauth_user)
@current_user = oauth_user.user
end

def clear_auth_token
@current_authorized_token = nil
session.delete :auth_token
end

end
end

0 comments on commit 2ea9ea8

Please sign in to comment.