Skip to content

Commit

Permalink
for MPP-3817: redirect inactive users to new account_inactive page
Browse files Browse the repository at this point in the history
  • Loading branch information
groovecoder committed May 24, 2024
1 parent fa31e8a commit 59a8b4f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
6 changes: 6 additions & 0 deletions frontend/src/pages/accounts/account_inactive.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@import "~@mozilla-protocol/core/protocol/css/includes/lib";

.error {
background-color: $color-red-60;
color: $color-white;
}
14 changes: 14 additions & 0 deletions frontend/src/pages/accounts/account_inactive.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { NextPage } from "next";

import { Layout } from "../../components/layout/Layout";
import styles from "./account_inactive.module.scss";

const AccountInactive: NextPage = () => {
return (
<Layout>
<div className={styles["error"]}>This account is not active.</div>
</Layout>
);
};

export default AccountInactive;
5 changes: 4 additions & 1 deletion privaterelay/allauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from urllib.parse import urlencode, urlparse

from django.http import Http404
from django.shortcuts import resolve_url
from django.shortcuts import redirect, resolve_url
from django.urls import resolve

from allauth.account.adapter import DefaultAccountAdapter
Expand Down Expand Up @@ -54,3 +54,6 @@ def is_safe_url(self, url: str | None) -> bool:
# The path is invalid
logger.error("No matching URL for '%s'", url)
return False

def respond_user_inactive(self, request, user):
return redirect("/accounts/account_inactive/")

0 comments on commit 59a8b4f

Please sign in to comment.