blu3-bird/Shopping-on-tuesday

Replace hard-coded route strings with constants in auth/routes.py

開放

#46 建立於 2025年12月10日

 (0 則留言) (0 個反應) (0 位負責人)CSS (16 個分叉)auto 404
documentationfrontendhelp wanted🐭good first issue🫎enhancement

倉庫指標

星標
 (5 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

[Refactor] Replace hard-coded route strings with constants in auth/routes.py

Description

The authentication routes file (app/auth/routes.py) contains hard-coded route name strings that should be replaced with constants for better maintainability.

Current Issues

File: app/auth/routes.py

Hard-coded strings found:

  • 'admin.dashboard' (appears 2 times in login function)
  • 'main.index' (appears 1 time in logout function)
  • 'auth.login' (appears 1 time in login function)

Problems

  • Typos only caught at runtime
  • Difficult to refactor if route names change

Reference

  • DEFAULT_AFTER_LOGIN = 'admin.dashboard'
  • DEFAULT_AFTER_LOGOUT = 'main.index'

Labels: enhancement, refactoring, code-quality Scope: app/auth/routes.py

貢獻者指南