Skip to content

Commit

Permalink
Merge pull request #1928 from ever-co/fix/logout-redirection
Browse files Browse the repository at this point in the history
fix: Logout Redirection and Auto Login for single team/workspace
  • Loading branch information
evereq authored Dec 1, 2023
2 parents 7707032 + f35eef6 commit ee7cabe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
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

0 comments on commit ee7cabe

Please sign in to comment.