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

TSK-637: Add login and recovery action #2654

Merged
merged 2 commits into from
Feb 17, 2023
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
2 changes: 1 addition & 1 deletion plugins/login-assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"ChangeAccount": "Change account",
"NotSeeingWorkspace": "Not seeing your workspace?",
"WorkspaceNameRule": "The workspace name can contains lowercase letters, numbers, and symbols !@#%&^-",
"ForgotPassword": "Forgot your password",
"ForgotPassword": "Forgot your password?",
"KnowPassword": "Know your password?",
"Recover": "Recover",
"PasswordRecovery": "Password recovery",
Expand Down
30 changes: 27 additions & 3 deletions plugins/login-resources/src/components/Join.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
}
}

$: bottom = page === 'login' ? [signUpAction] : [loginAction]
$: bottom = page === 'login' ? [signUpAction] : [loginJoinAction]
$: secondaryButtonLabel = page === 'login' ? login.string.SignUp : undefined
$: secondaryButtonAction = () => {
page = 'signUp'
Expand All @@ -96,12 +96,36 @@
func: () => (page = 'signUp')
}

const loginAction = {
const loginJoinAction = {
caption: login.string.HaveAccount,
i18n: login.string.LogIn,
func: () => (page = 'login')
}

const loginAction = {
caption: login.string.HaveAccount,
i18n: login.string.LogIn,
func: () => {
const loc = getCurrentLocation()
loc.path[1] = 'login'
loc.query = undefined
loc.path.length = 2
navigate(loc)
}
}

const recoveryAction = {
caption: login.string.ForgotPassword,
i18n: login.string.Recover,
func: () => {
const loc = getCurrentLocation()
loc.path[1] = 'password'
loc.query = undefined
loc.path.length = 2
navigate(loc)
}
}

onMount(() => {
check()
})
Expand Down Expand Up @@ -132,5 +156,5 @@
{action}
{secondaryButtonLabel}
{secondaryButtonAction}
bottomActions={bottom}
bottomActions={[...bottom, loginAction, recoveryAction]}
/>