Skip to content

Commit 3380915

Browse files
committed
Add remember me checkbox
1 parent c35c00a commit 3380915

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

packages/sprinkle-account/app/assets/interfaces/LoginApi.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type { UserDataInterface } from './'
99
export interface LoginRequest {
1010
user_name: string
1111
password: string
12+
rememberme?: boolean
1213
}
1314

1415
export interface LoginResponse {

packages/theme-pink-cupcake/src/components/Pages/Account/FormLogin.vue

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const loading = ref(false)
1010
const error = ref<AlertInterface | null>()
1111
let form: LoginRequest = {
1212
user_name: '',
13-
password: ''
13+
password: '',
14+
rememberme: false
1415
}
1516
1617
// Form action
@@ -27,12 +28,6 @@ async function sendLogin() {
2728
pos: 'top-right',
2829
timeout: 4000
2930
})
30-
31-
// If a redirect is set, redirect to it
32-
// TODO : Dilemma, should we redirect using VueRouter or not?
33-
// if (response.redirect) {
34-
// window.location.href = response.redirect
35-
// }
3631
})
3732
.catch((err: AlertInterface) => {
3833
error.value = err
@@ -71,6 +66,17 @@ async function sendLogin() {
7166
v-model="form.password" />
7267
</div>
7368
</div>
69+
<div class="uk-margin">
70+
<label class="uk-inline uk-width-1-1">
71+
<input
72+
class="uk-checkbox"
73+
type="checkbox"
74+
aria-label="Remember Me"
75+
data-test="rememberme"
76+
v-model="form.rememberme" />
77+
{{ $t('REMEMBER_ME') }}
78+
</label>
79+
</div>
7480
<div class="uk-text-center">
7581
<button class="uk-button uk-button-primary" :disabled="loading" data-test="submit">
7682
{{ $t('LOGIN') }}

0 commit comments

Comments
 (0)