Skip to content

Commit

Permalink
feat: redirect to user home if no other direction is set
Browse files Browse the repository at this point in the history
  • Loading branch information
Sparkier committed Oct 12, 2023
1 parent 8a96dd2 commit 1d8612d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/src/routes/(user)/login/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ export const actions: Actions = {
showReset: err.name === 'NotAuthorizedException'
});
}
throw redirect(303, data.has('redirect') ? (data.get('redirect') as string) : '/');
throw redirect(
303,
data.has('redirect') && data.get('redirect') !== ''
? (data.get('redirect') as string)
: `/${username}/projects`
);
}
};

0 comments on commit 1d8612d

Please sign in to comment.