Skip to content

Feature/session validation#723

Open
Process-ing wants to merge 2 commits into
feature/collaborative-sessionsfrom
feature/session-validation
Open

Feature/session validation#723
Process-ing wants to merge 2 commits into
feature/collaborative-sessionsfrom
feature/session-validation

Conversation

@Process-ing

@Process-ing Process-ing commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR adds some tweaks to the UI to accommodate the addition of user validation for collaborative sessions on the backend, e.g. modifying the create session button to redirect the user to the login page when not authenticated.

How to test

Follow the testing process described in the backend PR

@mariana2103
mariana2103 force-pushed the feature/session-validation branch from 1b6c050 to 75c2b14 Compare May 14, 2026 15:55

@mariana2103 mariana2103 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall the approach is solid.

};

const handleCreateSession = () => {
if (!userSignedIn) {

@mariana2103 mariana2103 May 14, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The auth guard is only added to handleCreateSession, but handleStartSession also calls sessionsSocket.connect(), which now requires a valid token. An unauthenticated user joining via a shared link (?session=...) or the sessions list will hit the fetchSocketToken 401, fall into the .catch, and see a generic "Erro ao entrar na sessão" toast instead of being redirected to login.

Needs the same guard:

Suggested change
if (!userSignedIn) {
const handleStartSession = (sessionId) => {
if (!userSignedIn) {
window.location.href = backendApi.OIDC_LOGIN_URL;
return;
}

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