Skip to content

Commit 6a85fee

Browse files
committed
refactor(api): update auth routes to use roles list for guest check
1 parent 3523c34 commit 6a85fee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routes/api/v1/auth/link-email.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Future<Response> onRequest(RequestContext context) async {
2222
// This should ideally be caught by `authenticationProvider` if route is protected
2323
throw const UnauthorizedException('Authentication required to link email.');
2424
}
25-
if (authenticatedUser.role != UserRole.guestUser) {
25+
if (!authenticatedUser.roles.contains(UserRoles.guestUser)) {
2626
throw const BadRequestException(
2727
'Account is already permanent. Cannot initiate email linking.',
2828
);

0 commit comments

Comments
 (0)