add support for nynorsk and english forgot password email template#2056
Conversation
|
Warning Review limit reached
More reviews will be available in 32 minutes and 53 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR adds localization support to the self-identified account-link email flow. ChangesLocalized email for self-identified link
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/Authentication/Controllers/SelfIdentifiedAuthenticationController.cs (1)
82-92:⚠️ Potential issue | 🟠 MajorMake
langoptional at the HTTP boundary.Line 82 currently declares
langas a non-nullablestringparameter with[FromQuery], which ASP.NET Core treats as required when nullable reference types are enabled (file has#nullable enable). This breaks the intended "default to empty string when not set" behavior and will reject existing callers that omitlang. The service method signature already expects this flexibility withstring lang = "".Suggested fix
- public async Task<ActionResult> RequestLink([FromQuery] string lang, [FromBody] SelfIdentifiedLinkRequest request, CancellationToken cancellationToken) + public async Task<ActionResult> RequestLink([FromQuery] string? lang, [FromBody] SelfIdentifiedLinkRequest request, CancellationToken cancellationToken) { @@ - string? maskedEmail = await _linkService.RequestLinkAsync(request.UserName, toPartyUuid, lang, cancellationToken); + string? maskedEmail = await _linkService.RequestLinkAsync(request.UserName, toPartyUuid, lang ?? string.Empty, cancellationToken);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/Authentication/Controllers/SelfIdentifiedAuthenticationController.cs` around lines 82 - 92, The lang parameter in the RequestLink method is currently declared as a non-nullable string, which causes ASP.NET Core to treat it as required when nullable reference types are enabled, breaking callers that omit it. Change the lang parameter type from string to string? in the method signature to make it optional at the HTTP boundary, allowing the service layer to handle the default empty string behavior as intended.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@test/Altinn.Platform.Authentication.Tests/Services/SelfIdentifiedLinkServiceTests.cs`:
- Around line 52-55: The RequestLink_ValidTarget_MintsTokenAndSendsEmailWithLink
test method currently only validates the default empty language code and English
language code through InlineData attributes. Add two additional InlineData test
cases to cover the nynorsk language path (with language code "no_nn" and its
corresponding expected subject) and the unknown-language fallback scenario (with
a non-existent language code and the fallback expected subject). This ensures
the new nynorsk path and fallback branch logic are properly tested alongside the
existing cases.
---
Outside diff comments:
In `@src/Authentication/Controllers/SelfIdentifiedAuthenticationController.cs`:
- Around line 82-92: The lang parameter in the RequestLink method is currently
declared as a non-nullable string, which causes ASP.NET Core to treat it as
required when nullable reference types are enabled, breaking callers that omit
it. Change the lang parameter type from string to string? in the method
signature to make it optional at the HTTP boundary, allowing the service layer
to handle the default empty string behavior as intended.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7347d332-c978-406c-9ab5-13ac80c5c38a
📒 Files selected for processing (5)
src/Authentication/Configuration/SelfIdentifiedLinkSettings.cssrc/Authentication/Controllers/SelfIdentifiedAuthenticationController.cssrc/Authentication/Services/Interfaces/ISelfIdentifiedLinkService.cssrc/Authentication/Services/SelfIdentifiedLinkService.cstest/Altinn.Platform.Authentication.Tests/Services/SelfIdentifiedLinkServiceTests.cs
|



Description
Related Issue(s)
Verification
Documentation
Summary by CodeRabbit
Release Notes
New Features
Tests