-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathModuleConfig.cfc
More file actions
55 lines (46 loc) · 2.45 KB
/
Copy pathModuleConfig.cfc
File metadata and controls
55 lines (46 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
component {
// The module has no required dependencies. SQLTokenStorage uses queryExecute(), which is built
// into CFML. QBTokenStorage loads qb only when an application chooses that storage provider.
this.title = "rememberMe";
// Register each model in onLoad() with an explicit WireBox name.
this.autoMapModels = false;
// Load the remember() application helper.
this.applicationHelper = [ "helpers/Mixins.cfm" ];
function configure() {
variables.settings = {
userServiceClass = "",
tokenEncryptKey = "", // Create a key with generateSecretKey("AES", 256).
tokenEncryptAlgorithm = "aes",
validatorHashAlgorithm = "MD5",
days = 30,
autoPurge = true, // Set this to false to disable the daily removal of old token rows.
purgeGraceDays = 1, // Keep an expired row for this many days. Use 0 to remove it after expiration.
purgeTime = "04:00", // Run the daily purge at this time in the server's time zone.
tokenStorageClass = "SQLTokenStorage@rememberMe", // WireBox name for a provider that follows ITokenStorage.cfc.
table = "user_remember", // Table used by the SQL and qb storage providers.
datasource = "" // Leave this empty to use the application's default datasource.
};
// Register the event announced after the service recalls a user.
variables.interceptorSettings = {
customInterceptionPoints = [
"onRecall"
]
};
}
function onLoad() {
binder.map( "RememberMeService@rememberMe" ).to( "#moduleMapping#.models.RememberMeService" );
// Use the dependency-free SQL provider by default.
binder.map( "SQLTokenStorage@rememberMe" ).to( "#moduleMapping#.models.SQLTokenStorage" );
// A singleton is one shared instance. MemoryTokenStorage must use a singleton so its saved
// tokens are still available when another service asks for the provider.
binder
.map( "MemoryTokenStorage@rememberMe" )
.to( "#moduleMapping#.models.MemoryTokenStorage" )
.asSingleton();
// This optional provider asks WireBox for qb only after an application selects the provider.
// The mapping can exist even when qb is not installed.
binder.map( "QBTokenStorage@rememberMe" ).to( "#moduleMapping#.models.QBTokenStorage" );
}
function onUnload() {
}
}