Skip to content

Commit f26d245

Browse files
committed
Add auth delegates
1 parent a88db43 commit f26d245

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

models/delegates/Auth.cfc

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* Copyright since 2016 by Ortus Solutions, Corp
3+
* www.ortussolutions.com
4+
* ---
5+
* This is a delegate only class to allow your application objects to deal with
6+
* authentication features via delegation.
7+
*/
8+
component singleton accessors="true" {
9+
10+
// DI
11+
property name="cbSecurity" inject="cbSecurity@cbsecurity";
12+
property name="jwtService" inject="JwtService@cbSecurity";
13+
14+
/**
15+
* Retrieve the Jwt Auth Service
16+
*/
17+
function jwtAuth() {
18+
return variables.jwtService;
19+
}
20+
21+
/**
22+
* Retrieve the CBSecurity Service Object
23+
*/
24+
function cbSecure() {
25+
return variables.cbsecurity;
26+
}
27+
28+
/**
29+
* Retrieve the Authentication Service
30+
*/
31+
function auth(){
32+
return variables.cbsecurity.getAuthService();
33+
}
34+
35+
}

0 commit comments

Comments
 (0)