Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions estela-api/api/views/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ def activate(self, request, *args, **kwargs):
user = User.objects.filter(pk=user_id)
if not user:
return redirect(
settings.CORS_ORIGIN_WHITELIST[0], {"error": "User does not exist."}
settings.FRONTEND_HOST, {"error": "User does not exist."}
)

user = user.get()
if user.is_active:
return redirect(
"".join([settings.CORS_ORIGIN_WHITELIST[0], "/activatedAccount"]),
"".join([settings.FRONTEND_HOST, "/activatedAccount"]),
{"message": "Account already activated!"},
)
elif account_reset_token.check_token(user, token):
Expand All @@ -129,15 +129,15 @@ def activate(self, request, *args, **kwargs):
)
email.send()
return redirect(
"".join([settings.CORS_ORIGIN_WHITELIST[0], "/activatedAccount"]),
"".join([settings.FRONTEND_HOST, "/activatedAccount"]),
{
"message": "Thank you for your email confirmation. You can now log in to your account."
},
)
else:
self.retry_send_verification_email(user, request)
return redirect(
settings.CORS_ORIGIN_WHITELIST[0],
settings.FRONTEND_HOST,
{"message": "Activation link is invalid!"},
)

Expand Down
2 changes: 2 additions & 0 deletions estela-api/config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
REDIS_URL=(str, "redis://redis"),
REDIS_STATS_INTERVAL=(str, "5.0"),
CORS_ORIGIN_WHITELIST=(str, "http://127.0.0.1:3000"),
DJANGO_FRONTEND_HOST=(str, "http://127.0.0.1:3000"),
AWS_ACCESS_KEY_ID=(str, "dummy"),
AWS_SECRET_ACCESS_KEY=(str, "dummy"),
AWS_DEFAULT_REGION=(str, "us-east-2"),
Expand Down Expand Up @@ -86,6 +87,7 @@
STAGE = env("STAGE")

DJANGO_API_HOST = env("DJANGO_API_HOST")
FRONTEND_HOST = env("DJANGO_FRONTEND_HOST")
ALLOWED_HOSTS = env("DJANGO_ALLOWED_HOSTS").split(",")

DJANGO_EXTERNAL_APPS = [x for x in env("DJANGO_EXTERNAL_APPS").split(",") if x]
Expand Down
2 changes: 1 addition & 1 deletion estela-api/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def send_verification_email(user, request):
def send_change_password_email(user):
mail_subject = "Change your estela password."
to_email = user.email
estela_domain = settings.CORS_ORIGIN_WHITELIST[0]
estela_domain = settings.FRONTEND_HOST
message = render_to_string(
"change_password_email.html",
{
Expand Down
6 changes: 3 additions & 3 deletions estela-web/src/pages/DeployListPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import WelcomeDeploy from "../../assets/images/welcomeDeploy.svg";

import "./styles.scss";
import { API_BASE_URL } from "../../constants";
import { ApiService } from "../../services";
import { ApiService, AuthService } from "../../services";
import { ApiProjectsDeploysListRequest, Deploy, UserDetail } from "../../services/api";
import { resourceNotAllowedNotification, Spin, PaginationItem } from "../../shared";
import { convertDateToString } from "../../utils";
Expand Down Expand Up @@ -280,7 +280,7 @@ export class DeployListPage extends Component<RouteComponentProps<RouteParams>,
<p className="text-white">$ cd quotesbot</p>
<p className="text-white">$ estela login</p>
<p className="text-white">Host [http://localhost]: {API_BASE_URL}</p>
<p className="text-white">Username: admin</p>
<p className="text-white">Username: {AuthService.getUserUsername()}</p>
<p className="text-white">Password:</p>
<p className="break-words text-white">$ estela init {this.projectId}</p>
<p className="text-white">$ estela deploy</p>
Expand All @@ -297,7 +297,7 @@ export class DeployListPage extends Component<RouteComponentProps<RouteParams>,
<p className="text-white">$ cd &lt;project_name&gt;</p>
<p className="text-white">$ estela login</p>
<p className="text-white">Host [http://localhost]: {API_BASE_URL}</p>
<p className="text-white">Username: admin</p>
<p className="text-white">Username: {AuthService.getUserUsername()}</p>
<p className="text-white">Password:</p>
<p className="break-words text-white">$ estela init {this.projectId}</p>
<p className="text-white">$ estela deploy</p>
Expand Down
1 change: 1 addition & 0 deletions estela-web/src/pages/RegisterPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export class RegisterPage extends Component<unknown, RegisterPageState> {
handleSubmit = (data: { email: string; username: string; password: string }): void => {
this.setState({ loading: true });
if (!this.validatePassword(data.password)) {
this.setState({ loading: false });
return;
}

Expand Down
1 change: 1 addition & 0 deletions installation/helm-chart/templates/API/api-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ data:
VERIFICATION_EMAIL: {{ .Values.VERIFICATION_EMAIL }}
REGISTER: {{ .Values.REGISTER | quote }}
DJANGO_API_HOST: http://{{ .Values.DJANGO_API_HOST }}
DJANGO_FRONTEND_HOST: {{ .Values.DJANGO_FRONTEND_HOST }}
DJANGO_ALLOWED_HOSTS: {{ .Values.DJANGO_API_HOST }},{{ .Values.DJANGO_ALLOWED_HOSTS }},127.0.0.1
STAGE: {{ .Values.STAGE }}
DEDICATED_SPIDER_NODES: {{ .Values.DEDICATED_SPIDER_NODES | quote}}
Expand Down
Loading