File tree Expand file tree Collapse file tree 2 files changed +52
-4
lines changed Expand file tree Collapse file tree 2 files changed +52
-4
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<v-container >
3
-
3
+ <v-layout row v-if =" error" >
4
+ <v-flex xs12 sm6 offset-sm3 >
5
+ <app-alert @dismissed =" onDismissed" :text =" error.message" ></app-alert >
6
+ </v-flex >
7
+ </v-layout >
4
8
<v-layout row >
5
9
<v-flex xs12 sm6 offset-sm3 >
6
10
<v-card >
56
60
password: ' '
57
61
}
58
62
},
63
+ computed: {
64
+ user () {
65
+ return this .$store .getters .user
66
+ },
67
+ error () {
68
+ return this .$store .getters .error
69
+ },
70
+ loading () {
71
+ return this .$store .getters .loading
72
+ }
73
+ },
74
+ watch: {
75
+ user (value ) {
76
+ if (value !== null && value !== undefined ) {
77
+ this .$router .push (' /' )
78
+ }
79
+ }
80
+ },
59
81
methods: {
60
82
onSignin () {
61
- //
83
+ this .$store .dispatch (' signUserIn' , {email: this .email , password: this .password })
84
+ },
85
+ onDismissed () {
86
+ this .$store .dispatch (' clearError' )
62
87
}
63
88
}
64
89
}
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<v-container >
3
-
3
+ <v-layout row v-if =" error" >
4
+ <v-flex xs12 sm6 offset-sm3 >
5
+ <app-alert @dismissed =" onDismissed" :text =" error.message" ></app-alert >
6
+ </v-flex >
7
+ </v-layout >
4
8
<v-layout row >
5
9
<v-flex xs12 sm6 offset-sm3 >
6
10
<v-card >
71
75
computed: {
72
76
comparePasswords () {
73
77
return this .password !== this .confirmPassword ? ' Passwords do not match' : ' '
78
+ },
79
+ user () {
80
+ return this .$store .getters .user
81
+ },
82
+ error () {
83
+ return this .$store .getters .error
84
+ },
85
+ loading () {
86
+ return this .$store .getters .loading
87
+ }
88
+ },
89
+ watch: {
90
+ user (value ) {
91
+ if (value !== null && value !== undefined ) {
92
+ this .$router .push (' /' )
93
+ }
74
94
}
75
95
},
76
96
methods: {
77
97
onSignup () {
78
- //
98
+ this .$store .dispatch (' signUserUp' , {email: this .email , password: this .password })
99
+ },
100
+ onDismissed () {
101
+ this .$store .dispatch (' clearError' )
79
102
}
80
103
}
81
104
}
You can’t perform that action at this time.
0 commit comments