mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-18 20:59:39 +02:00
Fix linting issues and update API key test for source validation
- Remove trailing whitespace in auth controller and mobile device model - Update API key test to expect new validation message with source 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
9336719242
commit
8296e10246
4 changed files with 7 additions and 5 deletions
|
@ -175,7 +175,7 @@ module Api
|
|||
def create_or_update_device(user)
|
||||
# Handle both string and symbol keys
|
||||
device_data = params[:device].permit(:device_id, :device_name, :device_type, :os_version, :app_version)
|
||||
|
||||
|
||||
device = user.mobile_devices.find_or_initialize_by(device_id: device_data[:device_id])
|
||||
device.update!(device_data.merge(last_seen_at: Time.current))
|
||||
device
|
||||
|
|
|
@ -27,7 +27,7 @@ class MobileDevice < ApplicationRecord
|
|||
scopes: "read_write", # Use the configured scope
|
||||
confidential: false # Public client for mobile
|
||||
)
|
||||
|
||||
|
||||
# Store the association
|
||||
update!(oauth_application: app)
|
||||
app
|
||||
|
@ -35,7 +35,7 @@ class MobileDevice < ApplicationRecord
|
|||
|
||||
def active_tokens
|
||||
return Doorkeeper::AccessToken.none unless oauth_application
|
||||
|
||||
|
||||
Doorkeeper::AccessToken
|
||||
.where(application: oauth_application)
|
||||
.where(resource_owner_id: user_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue