Skip to content

feature: include mfa in password reset flow#807

Merged
Renizmy merged 15 commits intomainfrom
feature-mfa-password-reset
Jan 26, 2026
Merged

feature: include mfa in password reset flow#807
Renizmy merged 15 commits intomainfrom
feature-mfa-password-reset

Conversation

@Renizmy
Copy link
Contributor

@Renizmy Renizmy commented Jan 12, 2026

No description provided.

@Renizmy Renizmy requested a review from yohanleb as a code owner January 12, 2026 18:33
@@ -0,0 +1,445 @@
package services
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If refactoring, let's replace all 500 error message by INTERNAL_SERVER_ERROR 😄

@@ -0,0 +1,445 @@
package services

import (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you adding anything here? If so can you highlight the changes pls

// MFA verification stage
if (stage === "mfa") {
return (
<Card className="mx-auto w-full max-w-md">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there not a reusable component for this already?

const refreshSession = useRefreshSession();
const [isValidated, setIsValidated] = useState(false);

// Flow state
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of the multiple hooks, can we use react hook form?

Also can we move some of the logic in its own hook?

Copy link
Contributor

@yohanleb yohanleb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments

Refacto token parsers
Refacto token structs
tokenString: accessToken,
allowedAudiences: []string{configuration.AudienceAccessToken},
requireBearer: true,
errorMessage: "invalid access token",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need errorMessage and audienceError? Can we not put a generic message?

// routeAudienceRules defines the security policy for restricted token access.
// Routes not listed here will reject restricted tokens entirely.
// This is the single source of truth for which audiences can access which endpoints.
var routeAudienceRules = []routeAudienceRule{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this fit with what we have in internal/configuration/auth.go, can we have one source of truth?

My worry is that we forget to update one of the places as the project grows.

Comment on lines 9 to 24
"/api/v1/auth/mfa/verify": {
{Path: "/api/v1/auth/mfa/verify", Method: "POST", RequireAuth: true},
},
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need all this? It looks like there is auth rules everywhere and it's going to be hard to maintain...

@Renizmy
Copy link
Contributor Author

Renizmy commented Jan 25, 2026

Screenshot from 2026-01-25 18-36-44

@Renizmy Renizmy merged commit 2d11759 into main Jan 26, 2026
2 checks passed
@Renizmy Renizmy deleted the feature-mfa-password-reset branch January 26, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants