diff --git a/studio/components/interfaces/SignIn/PasswordConditionsHelper.tsx b/studio/components/interfaces/SignIn/PasswordConditionsHelper.tsx
index 98df3524fd0..a2436717341 100644
--- a/studio/components/interfaces/SignIn/PasswordConditionsHelper.tsx
+++ b/studio/components/interfaces/SignIn/PasswordConditionsHelper.tsx
@@ -11,11 +11,11 @@ const PasswordConditionsHelper = ({ password }: PasswordConditionsHelperProps) =
return (
)
}
@@ -31,7 +31,7 @@ const PasswordCondition = ({ title, isMet }: PasswordConditionProps) => {
return (
diff --git a/studio/components/interfaces/SignIn/SignInForm.tsx b/studio/components/interfaces/SignIn/SignInForm.tsx
index bf4874b23f1..6498075f943 100644
--- a/studio/components/interfaces/SignIn/SignInForm.tsx
+++ b/studio/components/interfaces/SignIn/SignInForm.tsx
@@ -61,7 +61,7 @@ const SignInForm = () => {
return ui.setNotification({
id: toastId,
category: 'error',
- message: 'Please click the link sent to your email to confirm your account',
+ message: 'Account has not been verified, please check the link sent to your email',
})
}
diff --git a/studio/components/interfaces/SignIn/SignUpForm.tsx b/studio/components/interfaces/SignIn/SignUpForm.tsx
index 88c5883a3bc..e7777da7377 100644
--- a/studio/components/interfaces/SignIn/SignUpForm.tsx
+++ b/studio/components/interfaces/SignIn/SignUpForm.tsx
@@ -16,6 +16,7 @@ const signUpSchema = passwordSchema.shape({
const SignUpForm = () => {
const { ui } = useStore()
const captchaRef = useRef
(null)
+ const [showConditions, setShowConditions] = useState(false)
const [isSubmitted, setIsSubmitted] = useState(false)
const [passwordHidden, setPasswordHidden] = useState(true)
const [captchaToken, setCaptchaToken] = useState(null)
@@ -107,16 +108,24 @@ const SignUpForm = () => {
placeholder="••••••••"
disabled={isSubmitting}
autoComplete="new-password"
+ onFocus={() => setShowConditions(true)}
actions={
: }
type="default"
+ className="!mr-1"
onClick={() => setPasswordHidden((prev) => !prev)}
/>
}
/>
-
+
{
form="signUp-form"
htmlType="submit"
size="large"
- disabled={isSubmitting}
+ disabled={values.password.length === 0 || isSubmitting}
loading={isSubmitting}
>
Sign Up
diff --git a/studio/pages/account/me.tsx b/studio/pages/account/me.tsx
index 965cc47184c..9b3cbad9551 100644
--- a/studio/pages/account/me.tsx
+++ b/studio/pages/account/me.tsx
@@ -1,6 +1,6 @@
import { observer } from 'mobx-react-lite'
import { useEffect, useState } from 'react'
-import { IconArrowRight, IconMoon, IconSun, Input, Listbox } from 'ui'
+import { Button, IconArrowRight, IconMoon, IconSun, Input, Listbox } from 'ui'
import { Session } from '@supabase/supabase-js'
import { AccountLayout } from 'components/layouts'
@@ -60,46 +60,25 @@ const ProfileCard = observer(() => {
const [session, setSession] = useState(null)
useEffect(() => {
+ let cancel = false
;(async () => {
const {
data: { session },
} = await auth.getSession()
-
- if (session) {
- setSession(session)
- }
+ if (session && !cancel) setSession(session)
})()
+
+ return () => {
+ cancel = true
+ }
}, [])
return (
- {session?.user.app_metadata.provider === 'email' && (
-
-
- Password
-
- }
- >
-
-
-
-
-
- )}
-
{/* @ts-ignore */}
{
)
})
-const Profile = observer(() => {
+const Profile = observer(({ session }: any) => {
const { ui } = useStore()
return (
@@ -154,6 +133,22 @@ const Profile = observer(() => {
layout="horizontal"
value={ui.profile?.primary_email ?? ''}
/>
+ {session?.user.app_metadata.provider === 'email' && (
+
+ )}
diff --git a/studio/pages/join/index.tsx b/studio/pages/join/index.tsx
index 3381295990b..be1c151a700 100644
--- a/studio/pages/join/index.tsx
+++ b/studio/pages/join/index.tsx
@@ -32,7 +32,7 @@ const JoinOrganizationPage = () => {
const { token_does_not_exist, email_match, expired_token, organization_name, invite_id } =
tokenValidationInfo || {}
- const loginRedirectLink = `/?next=${encodeURIComponent(`/join?token=${token}&slug=${slug}`)}`
+ const loginRedirectLink = `/?returnTo=${encodeURIComponent(`/join?token=${token}&slug=${slug}`)}`
useEffect(() => {
const fetchTokenInfo = async () => {
diff --git a/studio/pages/sign-in.tsx b/studio/pages/sign-in.tsx
index 8f102539391..a1ef0ac8163 100644
--- a/studio/pages/sign-in.tsx
+++ b/studio/pages/sign-in.tsx
@@ -1,42 +1,11 @@
import SignInForm from 'components/interfaces/SignIn/SignInForm'
import SignInWithGitHub from 'components/interfaces/SignIn/SignInWithGitHub'
import { SignInLayout } from 'components/layouts'
-import Connecting from 'components/ui/Loading'
-import { auth } from 'lib/gotrue'
import Link from 'next/link'
-import { NextRouter, useRouter } from 'next/router'
-import { useEffect } from 'react'
import { NextPageWithLayout } from 'types'
-// detect for redirect from 3rd party service like vercel, aws...
-const isRedirectFromThirdPartyService = (router: NextRouter) => router.query.next !== undefined
-
const SignInPage: NextPageWithLayout = () => {
- const router = useRouter()
- const autoSignIn = isRedirectFromThirdPartyService(router)
-
- useEffect(() => {
- if (autoSignIn) {
- const queryParams = (router.query as any) || {}
- const params = new URLSearchParams(queryParams)
-
- // trigger github signIn
- auth.signInWithOAuth({
- provider: 'github',
- options: {
- redirectTo: `${
- process.env.NEXT_PUBLIC_VERCEL_ENV === 'preview'
- ? process.env.NEXT_PUBLIC_VERCEL_URL
- : process.env.NEXT_PUBLIC_SITE_URL
- }?${params.toString()}`,
- },
- })
- }
- }, [])
-
- return autoSignIn ? (
-
- ) : (
+ return (
<>