Skip to content

feat(presets): add devices_module to auth:hardened, b2b, and b2b:storage presets#1160

Merged
pyramation merged 1 commit into
mainfrom
feat/add-devices-module-to-presets
May 14, 2026
Merged

feat(presets): add devices_module to auth:hardened, b2b, and b2b:storage presets#1160
pyramation merged 1 commit into
mainfrom
feat/add-devices-module-to-presets

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

Summary

Adds devices_module to the three production-grade module presets: auth:hardened, b2b, and b2b:storage.

The user_auth_module insert trigger in constructive-db already looks up devices_module and threads user_devices_table_id / device_settings_table_id through to the sign_in and sign_in_identity generators. However, no preset actually included devices_module in its modules list — so device tracking (trusted-device MFA bypass, device token cookies) was never provisioned.

What changed:

  • auth:hardened — added devices_module (production consumer auth with full surfaces)
  • b2b — added devices_module (multi-tenant B2B)
  • b2b:storage — added devices_module (B2B + file uploads)

Not changed:

  • full — uses modules: ['all'], already picks up everything implicitly
  • minimal, auth:email, auth:email+magic, auth:sso, auth:passkey — lighter presets where device tracking adds unnecessary overhead

Triggered by review feedback on #1141 (OAuth identity sign-in), item #7.

Review & Testing Checklist for Human

  • Verify devices_module is correctly positioned in each preset's dependency order (after sessions_module, user_auth_module)
  • After merging, re-provision a test database with b2b:storage preset and confirm user_devices + device_settings tables are created
  • Confirm sign_in_identity generated function now includes device_token IN param and out_device_token OUT param when provisioned with this preset

Notes

There are two related constructive-db follow-ups identified from the same review:

  1. sign_up_identity missing device support — the body generator has no device params, so new OAuth signups won't get device tracking even after this preset change
  2. sign_in_identity missing remember_me — always uses default_session_duration; the regular sign_in already supports remember_me for extended sessions

Link to Devin session: https://app.devin.ai/sessions/dd0bdd01d4cd47e1a432390593fd68d8
Requested by: @pyramation

…age presets

The devices_module was missing from all module presets. The
user_auth_module insert trigger already looks up devices_module and
threads it through sign_in/sign_in_identity, but no preset actually
included it — so device tracking was never provisioned.

Add devices_module to the three production-grade presets that already
have the full auth surface (rate limits, SSO, passkeys, MFA):
- auth:hardened
- b2b
- b2b:storage

The full preset uses modules: ['all'] so it picks up devices_module
implicitly. Lighter presets (auth:email, auth:sso, auth:passkey) are
left without it — device tracking is a hardened/production feature.
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@pyramation pyramation merged commit 91ac642 into main May 14, 2026
37 checks passed
@pyramation pyramation deleted the feat/add-devices-module-to-presets branch May 14, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant