Skip to content

Commit 3238f19

Browse files
author
Blair McKenzie
committed
basic auth fix
1 parent ee29170 commit 3238f19

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/lib/api.cfc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ component {
578578
var stResult = {};
579579
var i = 0;
580580

581-
if (structKeyExists(arguments.req.headers, "Authorization") and reFindNoCase("^Basic \w+$", arguments.req.headers.Authorization)) {
581+
if (structKeyExists(arguments.req.headers, "Authorization") and reFindNoCase("^Basic .+$", arguments.req.headers.Authorization)) {
582582
auth = ToString(ToBinary(listLast(arguments.req.headers.Authorization, " ")));
583583
form.userlogin = listFirst(auth, ":");
584584
form.password = listRest(auth, ":");
@@ -588,7 +588,9 @@ component {
588588
arguments.req.user = {
589589
"id" = stResult.userid & "_CLIENTUD",
590590
"authentication" = "basic",
591-
"groups" = application.security.userdirectories.CLIENTUD.getUserGroups(stResult.userid)
591+
"profile" = application.fapi.getContentType("dmProfile").getProfile(stResult.userid, stResult.ud),
592+
"groups" = application.security.userdirectories.CLIENTUD.getUserGroups(stResult.userid),
593+
"roles" = []
592594
};
593595

594596
for (i=1; i<=arrayLen(arguments.req.user.groups); i++) {

0 commit comments

Comments
 (0)