Skip to content

Commit 221f5d1

Browse files
committed
refactor(api): update link-email check to use user.appRole
1 parent 347b347 commit 221f5d1

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.roles.contains(UserRoles.guestUser)) {
25+
if (authenticatedUser.appRole != AppUserRole.guestUser) {
2626
throw const BadRequestException(
2727
'Account is already permanent. Cannot initiate email linking.',
2828
);

0 commit comments

Comments
 (0)