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

web/flows: fix RedirectStage not detecting absolute URLs correctly #5781

Merged
merged 2 commits into from May 29, 2023
Merged

web/flows: fix RedirectStage not detecting absolute URLs correctly #5781

merged 2 commits into from May 29, 2023

Conversation

Saeverix
Copy link
Contributor

Details

Changes

New Features

  • getURL() method in RedirectStage.ts now actually detects URLs

Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

If an API change has been made

  • The API schema has been updated (make gen-build)

If changes to the frontend have been made

  • The code has been formatted (make web)
  • The translation files have been updated (make i18n-extract)

If applicable

  • The documentation has been updated
  • The documentation has been formatted (make website)

…5732)

Signed-off-by: Saeverix <1863379+Saeverix@users.noreply.github.com>
@Saeverix Saeverix requested a review from a team as a code owner May 28, 2023 22:43
@Smallinger
Copy link

Smallinger commented May 29, 2023

After I built my own Authentik image with the changes that @Saeverix made, I can confirm that all my OAuth connections are working properly. I am using:

  • Portainer
  • Proxmox
  • Nginx Proxy Manager
  • Nextcloud
  • Gitea
  • Coder
  • Proxy Auth
  • Element / Matrix
  • Jellyfin

Everything is working perfectly!

@Saeverix
Copy link
Contributor Author

@Smallinger thanks for checking my changes and confirming that it works.

@BeryJu
Copy link
Member

BeryJu commented May 29, 2023

I've simplified the code a bit to use the native JS URL APIs and tested it with Portainer locally

@codecov
Copy link

codecov bot commented May 29, 2023

Codecov Report

Patch coverage has no change and project coverage change: -66.21 ⚠️

Comparison is base (3e64409) 92.63% compared to head (c82c833) 26.42%.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5781       +/-   ##
===========================================
- Coverage   92.63%   26.42%   -66.21%     
===========================================
  Files         547      547               
  Lines       26250    26250               
===========================================
- Hits        24314     6933    -17381     
- Misses       1936    19317    +17381     
Flag Coverage Δ
e2e ?
integration 26.42% <ø> (ø)
unit ?

Flags with carried forward coverage won't be shown. Click here to find out more.

see 492 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Saeverix
Copy link
Contributor Author

@BeryJu that's also a nice change to prevent the new URL() to fail. Nice work!

@BeryJu BeryJu changed the title getURL() method in RedirectStage.ts now actually detects URLs #5732 web/flows: fix RedirectStage not detecting absolute URLs correctly May 29, 2023
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
@BeryJu BeryJu enabled auto-merge (squash) May 29, 2023 12:08
@netlify
Copy link

netlify bot commented May 29, 2023

Deploy Preview for authentik ready!

Name Link
🔨 Latest commit c82c833
🔍 Latest deploy log https://app.netlify.com/sites/authentik/deploys/647495aea0fb3000087eb4a5
😎 Deploy Preview https://deploy-preview-5781--authentik.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@BeryJu BeryJu merged commit 47a916a into goauthentik:main May 29, 2023
47 of 56 checks passed
kensternberg-authentik added a commit that referenced this pull request May 30, 2023
* main: (58 commits)
  web: bump @babel/preset-env from 7.22.2 to 7.22.4 in /web (#5808)
  web: bump @typescript-eslint/eslint-plugin from 5.59.7 to 5.59.8 in /web (#5805)
  web: bump @babel/plugin-transform-runtime from 7.22.2 to 7.22.4 in /web (#5806)
  web: bump @typescript-eslint/parser from 5.59.7 to 5.59.8 in /web (#5807)
  stages/deny: fix typos (#5800)
  core: bump coverage from 7.2.6 to 7.2.7 (#5809)
  blueprints: allow setting user's passwords from blueprints (#5797)
  providers/proxy: add support for traefik.io API and CRD (#5801)
  web: fix build (#5798)
  web/flows: fix RedirectStage not detecting absolute URLs correctly (#5781)
  lifecycle: Add depends_on for worker and server container (#5634)
  web: bump @babel/preset-env from 7.21.5 to 7.22.2 in /web (#5791)
  web: bump @babel/plugin-proposal-decorators from 7.21.0 to 7.22.3 in /web (#5787)
  web: bump @lingui/core from 4.1.2 to 4.2.0 in /web (#5782)
  website: bump postcss from 8.4.23 to 8.4.24 in /website (#5783)
  web: bump @babel/plugin-transform-runtime from 7.21.4 to 7.22.2 in /web (#5789)
  core: bump goauthentik.io/api/v3 from 3.2023051.3 to 3.2023052.1 (#5788)
  web: bump @babel/core from 7.21.8 to 7.22.1 in /web (#5790)
  web: bump yaml from 2.3.0 to 2.3.1 in /web (#5792)
  core: bump django-otp from 1.2.0 to 1.2.1 (#5794)
  ...
BeryJu added a commit that referenced this pull request May 31, 2023
…5781)

* web: getURL() method in RedirectStage.ts now actually detects URLs (#5732)

Signed-off-by: Saeverix <1863379+Saeverix@users.noreply.github.com>

* use native API to build full URL

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Saeverix <1863379+Saeverix@users.noreply.github.com>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
kensternberg-authentik added a commit that referenced this pull request Jun 1, 2023
* main:
  web: bump API Client version (#5826)
  release: 2023.5.3
  website/docs: prepare 2023.5.3 (#5824)
  ci: build outpost binaries statically linked (#5823)
  blueprints: fix API validation with OCI blueprint path (#5822)
  ci: replace github bot account with github app (#5819)
  providers/ldap: fix LDAP Outpost application selection (#5812)
  stages/deny: fix typos (#5800)
  web/flows: fix RedirectStage not detecting absolute URLs correctly (#5781)
kensternberg-authentik added a commit that referenced this pull request Jun 5, 2023
* main:
  web: bump API Client version (#5826)
  release: 2023.5.3
  website/docs: prepare 2023.5.3 (#5824)
  ci: build outpost binaries statically linked (#5823)
  blueprints: fix API validation with OCI blueprint path (#5822)
  ci: replace github bot account with github app (#5819)
  providers/ldap: fix LDAP Outpost application selection (#5812)
  stages/deny: fix typos (#5800)
  web/flows: fix RedirectStage not detecting absolute URLs correctly (#5781)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Portianer OAuth is broken after update.
3 participants