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

Use origin request param instead of process.env.ALIAS #1004

Merged
merged 11 commits into from
Nov 17, 2023

Conversation

dbauszus-glx
Copy link
Member

@dbauszus-glx dbauszus-glx commented Nov 14, 2023

The ALIAS environment variable was introduced to alias redirected request.

For example the host host xyz-blog-dev.vercel.app maybe routed through geolytix.dev. In this case the origin will be unknown can be parsed from the request.header.referer like so:

  const host = `${req.headers.origin 
    || req.headers.referer && new URL(req.headers.referer).origin 
    || process.env.ALIAS 
    || req.headers.host}${process.env.DIR}`

The user admin view script should set the login URL parameter flag if no user is provided.

The user mod routes which require a user should return the login view.

The ALIAS is required for cosmetics on the admin email.

image

The verify link does not have a referer since the link is opened directly in the browser, not through a view.

Protocol shouldn't be required though since can follow a host in link.

Without the alias the admin will get the vercel.app domain. Which should still work.

@dbauszus-glx dbauszus-glx linked an issue Nov 14, 2023 that may be closed by this pull request
@dbauszus-glx dbauszus-glx added the Code Issues related to the code structure and performance. label Nov 14, 2023
@dbauszus-glx dbauszus-glx marked this pull request as ready for review November 15, 2023 09:46
@dbauszus-glx dbauszus-glx marked this pull request as draft November 15, 2023 09:58
@dbauszus-glx dbauszus-glx marked this pull request as ready for review November 15, 2023 18:47
@dbauszus-glx dbauszus-glx added the Bug A genuine bug. There must be some form of error exception to work with. label Nov 15, 2023
@RobAndrewHurst
Copy link
Contributor

When approving a user on the admin panel, I am not seeing an email being sent to the user confirming that they are approved.

Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@RobAndrewHurst RobAndrewHurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! All working!

@RobAndrewHurst RobAndrewHurst merged commit d41bfe1 into GEOLYTIX:main Nov 17, 2023
6 checks passed
@dbauszus-glx dbauszus-glx deleted the process-env-alias branch January 29, 2024 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A genuine bug. There must be some form of error exception to work with. Code Issues related to the code structure and performance.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ALIAS or HOST
2 participants