Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
package com.authentication.shrine.utility

object Constants {
const val SESSION_ID_KEY = "SESAME_SESSION_COOKIE="
const val SESSION_ID_KEY = "__Secure-SESAME_SESSION_COOKIE="

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This constant SESSION_ID_KEY is also defined in Shrine/wear/src/main/java/com/authentication/shrinewear/network/AuthNetworkClient.kt. Duplicating constants across different modules can lead to maintenance issues and inconsistencies. If this value needs to be updated in the future, it must be changed in multiple places, which is error-prone.

To improve this, consider creating a shared Gradle module (e.g., :common or :core) that both the :app and :wear modules can depend on. You could then define SESSION_ID_KEY once in this shared module and use it across the project. This adheres to the Don't Repeat Yourself (DRY) principle and improves long-term maintainability.

}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AuthNetworkClient {
/**
* The key used for the session ID cookie.
*/
internal const val SESSION_ID_KEY = "SESAME_SESSION_COOKIE="
internal const val SESSION_ID_KEY = "__Secure-SESAME_SESSION_COOKIE="
}

init {
Expand Down