Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Logout Redirection and Auto Login for single team/workspace #1928

Merged
merged 1 commit into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/app/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { JitsuOptions } from '@jitsu/jitsu-react/dist/useJitsu';
import { I_SMTPRequest } from './interfaces/ISmtp';

export const API_BASE_URL = '/api';
export const DEFAULT_APP_PATH = '/auth/team';
export const DEFAULT_APP_PATH = '/auth/passcode';
export const DEFAULT_MAIN_PATH = '/';
export const PROTECTED_APP_URL_PATHS: RegExp[] = [
/^\/$/,
Expand Down
7 changes: 5 additions & 2 deletions apps/web/pages/auth/passcode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,11 @@ function WorkSpaceScreen({ form, className }: { form: TAuthenticationPasscode }
useEffect(() => {
if (form.workspaces.length === 1) {
setSelectedWorkspace(0);
form.workspaces[0].current_teams.length === 1 &&
setSelectedTeam(form.workspaces[0].current_teams[0].team_id);
}
if (form.workspaces.length === 1 && form.workspaces[0].current_teams.length === 1) {
setSelectedTeam(form.workspaces[0].current_teams[0].team_id);
}
if (form.workspaces.length === 1 && form.workspaces[0].current_teams.length <= 1) {
setTimeout(() => {
document.getElementById('continue-to-workspace')?.click();
}, 100);
Expand Down