mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: signup remaining bugs
This commit is contained in:
parent
0d775a0fe9
commit
fdd21c2eda
4 changed files with 57 additions and 51 deletions
|
|
@ -240,12 +240,14 @@ async def delete_invite_code(
|
||||||
)
|
)
|
||||||
|
|
||||||
# Delete invite code
|
# Delete invite code
|
||||||
invite_code = r.delete(f"{invite_code_uuid}:org:{org.org_uuid}:code:*")
|
keys = r.keys(f"{invite_code_uuid}:org:{org.org_uuid}:code:*")
|
||||||
|
if keys:
|
||||||
|
r.delete(*keys)
|
||||||
|
|
||||||
if not invite_code:
|
if not keys:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=404,
|
status_code=404,
|
||||||
detail="Invite code not found",
|
detail="Invite code not found",
|
||||||
)
|
)
|
||||||
|
|
||||||
return invite_code
|
return keys
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ export async function generateMetadata(
|
||||||
): Promise<Metadata> {
|
): Promise<Metadata> {
|
||||||
const orgslug = params.orgslug;
|
const orgslug = params.orgslug;
|
||||||
// Get Org context information
|
// Get Org context information
|
||||||
const org = await getOrganizationContextInfo(orgslug, { revalidate: 1800, tags: ['organizations'] });
|
const org = await getOrganizationContextInfo(orgslug, { revalidate: 0, tags: ['organizations'] });
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: 'Login' + ` — ${org.name}`,
|
title: 'Login' + ` — ${org.name}`,
|
||||||
|
|
@ -21,7 +21,7 @@ export async function generateMetadata(
|
||||||
|
|
||||||
const Login = async (params: any) => {
|
const Login = async (params: any) => {
|
||||||
const orgslug = params.params.orgslug;
|
const orgslug = params.params.orgslug;
|
||||||
const org = await getOrganizationContextInfo(orgslug, { revalidate: 1800, tags: ['organizations'] });
|
const org = await getOrganizationContextInfo(orgslug, { revalidate: 0, tags: ['organizations'] });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ export async function generateMetadata(
|
||||||
): Promise<Metadata> {
|
): Promise<Metadata> {
|
||||||
const orgslug = params.orgslug;
|
const orgslug = params.orgslug;
|
||||||
// Get Org context information
|
// Get Org context information
|
||||||
const org = await getOrganizationContextInfo(orgslug, { revalidate: 1800, tags: ['organizations'] });
|
const org = await getOrganizationContextInfo(orgslug, { revalidate: 0, tags: ['organizations'] });
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: 'Sign up' + ` — ${org.name}`,
|
title: 'Sign up' + ` — ${org.name}`,
|
||||||
|
|
@ -24,7 +24,7 @@ export async function generateMetadata(
|
||||||
|
|
||||||
const SignUp = async (params: any) => {
|
const SignUp = async (params: any) => {
|
||||||
const orgslug = params.params.orgslug;
|
const orgslug = params.params.orgslug;
|
||||||
const org = await getOrganizationContextInfo(orgslug, { revalidate: 1800, tags: ['organizations'] });
|
const org = await getOrganizationContextInfo(orgslug, { revalidate: 0, tags: ['organizations'] });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
|
||||||
|
|
@ -67,10 +67,14 @@ function SignUpClient(props : SignUpClientProps) {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="left-join-part bg-white flex flex-row">
|
<div className="left-join-part bg-white flex flex-row">
|
||||||
{joinMethod == 'open' && <OpenSignUpComponent />}
|
{joinMethod == 'open' && (
|
||||||
{joinMethod == 'inviteOnly' && inviteCode && session.isAuthenticated && <LoggedInJoinScreen />}
|
session.isAuthenticated ? <LoggedInJoinScreen inviteCode={inviteCode} /> : <OpenSignUpComponent />
|
||||||
{joinMethod == 'inviteOnly' && inviteCode && !session.isAuthenticated && <InviteOnlySignUpComponent inviteCode={inviteCode} />}
|
)}
|
||||||
{joinMethod == 'inviteOnly' && !inviteCode && <NoTokenScreen />}
|
{joinMethod == 'inviteOnly' && (
|
||||||
|
inviteCode ? (
|
||||||
|
session.isAuthenticated ? <LoggedInJoinScreen /> : <InviteOnlySignUpComponent inviteCode={inviteCode} />
|
||||||
|
) : <NoTokenScreen />
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue