Skip to content

Commit

Permalink
parametrize redirect after login
Browse files Browse the repository at this point in the history
  • Loading branch information
ohad.r committed Jul 8, 2024
1 parent df708b1 commit 33ff01e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/web/user-action-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const SC_LOCKED = 423;
export function config(config: {
user_app: object,
authenticationAccountRepository: AuthenticationAccountRepository,
redirectAfterLogin: string,
}) {
app = config.user_app;
AuthenticationFlowsProcessor.instance.authenticationAccountRepository = config.authenticationAccountRepository;
Expand Down Expand Up @@ -70,7 +71,7 @@ export function config(config: {
req.session.success = 'Authenticated as ' + user.email
+ ' click to <a href="/logout">logout</a>. '
+ ' You may now access <a href="/restricted">/restricted</a>.';
res.redirect('back');
res.redirect(config.redirectAfterLogin || '/');
});
});

Expand Down

0 comments on commit 33ff01e

Please sign in to comment.