Skip to content

Commit

Permalink
remove OpenStruct usage from AccessToken
Browse files Browse the repository at this point in the history
Change-Id: I3a203d298a01e2e6f355a0cd4e401ecd42fb37c9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/345275
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
  • Loading branch information
ccutrer committed Apr 19, 2024
1 parent 41bebd6 commit be20e87
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions app/models/access_token.rb
Expand Up @@ -65,12 +65,7 @@ class AccessToken < ActiveRecord::Base
scope :not_deleted, -> { where(workflow_state: "active") }

TOKEN_SIZE = 64
TOKEN_TYPES = OpenStruct.new(
{
crypted_token: :crypted_token,
crypted_refresh_token: :crypted_refresh_token
}
)
TOKEN_TYPES = [:crypted_token, :crypted_refresh_token].freeze

before_create :generate_token
before_create :generate_refresh_token
Expand Down
2 changes: 1 addition & 1 deletion spec/models/access_token_spec.rb
Expand Up @@ -68,7 +68,7 @@
end

context "when an access token argument is provided" do
subject { AccessToken.authenticate(token.full_token, AccessToken::TOKEN_TYPES.crypted_token, token) }
subject { AccessToken.authenticate(token.full_token, :crypted_token, token) }

let(:token) { AccessToken.create!(user: user_model) }
let(:user) { user_model }
Expand Down

0 comments on commit be20e87

Please sign in to comment.