Skip to content

Commit e44d579

Browse files
committed
fix: Allow returning null from lookup
1 parent d4cb3ea commit e44d579

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

models/ICredentialRepository.cfc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ interface displayname="ICredentialRepository" {
99
public string function getUsernameForUserHandle( required any userHandle );
1010

1111
/**
12+
* `credentialId` and `userHandle` are both binary data
1213
* Returns a struct with a `publicKey` and a `signatureCount` property.
14+
* `null` if no credential is found.
1315
*/
14-
public struct function lookup( required any credentialId, required any userHandle );
16+
public any function lookup( required any credentialId, required any userHandle );
1517
/**
1618
* Returns a struct with a `userHandle`, `publicKey` and a `signatureCount` property.
1719
*/

resources/examples/cborm/Passkey.cfc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,9 @@ component
140140
/**
141141
* `credentialId` and `userHandle` are both binary data
142142
* Returns a struct with a `publicKey` and a `signatureCount` property.
143+
* `null` if no credential is found.
143144
*/
144-
public struct function lookup( required any credentialId, required any userHandle ) {
145+
public any function lookup( required any credentialId, required any userHandle ) {
145146
var passkey = this
146147
.newCriteria()
147148
.eq( "credentialId", arguments.credentialId )

resources/examples/quick/Passkey.cfc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ component extends="quick.models.BaseEntity" accessors="true" implements="cbsecur
8383
/**
8484
* `credentialId` and `userHandle` are both binary data
8585
* Returns a struct with a `publicKey` and a `signatureCount` property.
86+
* `null` if no credential is found.
8687
*/
87-
public struct function lookup( required any credentialId, required any userHandle ) {
88+
public any function lookup( required any credentialId, required any userHandle ) {
8889
var passkey = newEntity()
8990
.where( "credentialId", credentialId )
9091
.where( "userId", toString( userHandle ) )

0 commit comments

Comments
 (0)