Skip to content

FAC-34 feat: implement login strategy pattern for auth service#60

Open
y4nder wants to merge 1 commit intodevelopfrom
feat/fac-34
Open

FAC-34 feat: implement login strategy pattern for auth service#60
y4nder wants to merge 1 commit intodevelopfrom
feat/fac-34

Conversation

@y4nder
Copy link
Member

@y4nder y4nder commented Feb 25, 2026

Summary

  • Refactored AuthService.Login() to use a strategy pattern separating local password auth from Moodle SSO
  • Added LoginStrategy interface with priority-based ordering for extensibility
  • Created LocalLoginStrategy (priority 10) and MoodleLoginStrategy (priority 100)
  • Added eslint rule to allow underscore-prefixed unused params project-wide

Changes

  • New files: src/modules/auth/strategies/ - interface, implementations, and tests
  • Modified: AuthService now injects and sorts strategies by priority
  • Modified: eslint.config.mjs - added argsIgnorePattern: '^_' rule

Test plan

  • All 103 unit tests pass
  • Lint passes
  • Priority sorting verified with dedicated test
  • MoodleConnectivityError handling preserved
  • Manual test: local user login
  • Manual test: Moodle SSO login

Refactor AuthService.Login() to use a strategy pattern that separates
local password authentication from Moodle SSO authentication.

- Add LoginStrategy interface with priority-based ordering
- Create LocalLoginStrategy (priority 10) for local password auth
- Create MoodleLoginStrategy (priority 100) for Moodle SSO
- Strategies auto-sorted by priority in AuthService constructor
- Add eslint rule to allow underscore-prefixed unused params
- Preserve transactional integrity and MoodleConnectivityError handling

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@y4nder y4nder self-assigned this Feb 25, 2026
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