Skip to content

Redirect after login does not work when the target URL is not a view #10682

Closed
vaadin/spring
#770

Description

@Artur-

Description of the bug / feature

Configured admin only access for a resource

http.authorizeRequests().antMatchers("/admin-only/**").hasAnyRole("admin");

Open /admin-only/secret.txt and log in as a user who has the "admin" role

Expected behavior

After login you see the resource

Actual behavior

You stay in the login view with the message

Incorrect username or password
Check that you have entered the correct username and password and try again.

Versions:

- Vaadin / Flow version:20 snapshot

Activity

  1. Artur- commented on Apr 15, 2021

    @Artur-
    MemberAuthor

    The problem here is that

            const vaadinCsrfToken = await updateCsrfTokensBasedOnResponse(response);
            if (vaadinCsrfToken) {
    

    can never succeed for anything else than a view. If there is no CSRF token, maybe redirect instead?

  2. added a commit that references this issue on Apr 16, 2021
    5d8b635
  3. added a commit that references this issue on Apr 19, 2021
    aa2039c
  4. added a commit that references this issue on Apr 22, 2021
    5b92551
  5. added a commit that references this issue on Feb 8, 2022
    07e65d5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughillaIssues related to Hilla

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions