Skip to content

fix(security): enforce portal auth validation on set-password flow#100

Merged
JanZachmann merged 1 commit intoomnect:mainfrom
JanZachmann:fix/set-password-portal-auth-gate
Feb 18, 2026
Merged

fix(security): enforce portal auth validation on set-password flow#100
JanZachmann merged 1 commit intoomnect:mainfrom
JanZachmann:fix/set-password-portal-auth-gate

Conversation

@JanZachmann
Copy link
Contributor

@JanZachmann JanZachmann commented Feb 18, 2026

Summary

When portal token validation fails (wrong signature, insufficient role, etc.), the OIDC user remains in localStorage. This allows manual navigation to /set-password, which has no auth middleware — bypassing the portal auth gate entirely.

Two-layer fix:

  • Backend: validate_portal_token() stores a portal_validated session flag on success; set_password() rejects requests without the flag (HTTP 401)
  • Frontend: Callback.vue clears the OIDC user from localStorage on validation failure so the router guard blocks manual navigation

When portal token validation fails (e.g. wrong signature, insufficient
role), the OIDC user remains in localStorage, allowing manual navigation
to /set-password which has no auth middleware — effectively bypassing
the portal auth gate.

Two-layer fix:
- Backend: validate_portal_token() stores a session flag on success;
  set_password() rejects requests without the flag (401).
- Frontend: Callback.vue clears the OIDC user from localStorage on
  validation failure so the router guard blocks manual navigation.

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
@JanZachmann JanZachmann merged commit 9628126 into omnect:main Feb 18, 2026
3 checks passed
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.

1 participant

Comments