Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nuxtjschat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyễn Đức Huy
nuxtjschat
Commits
202af87d
Commit
202af87d
authored
Dec 15, 2020
by
Nguyễn Đức Huy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Login
parent
9ff8fbd4
Pipeline
#1135
canceled with stages
in 0 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
14 deletions
+37
-14
pages/login.vue
+30
-9
pages/register/index.vue
+7
-5
No files found.
pages/login.vue
View file @
202af87d
...
...
@@ -7,26 +7,31 @@
</div>
<h1
class=
"fadein second"
>
Login
</h1>
<!-- Login Form -->
<form
@
submit
.
prevent=
"onSubmit"
>
<input
id=
"login
"
v-model=
"username
"
id=
"email
"
v-model=
"email
"
type=
"text"
class=
"fadein second"
name=
"login
"
placeholder=
"login
"
name=
"email
"
placeholder=
"Email
"
/>
<input
id=
"password"
v-model=
"password"
type=
"password"
class=
"fadein third"
name=
"login
"
placeholder=
"p
assword"
name=
"password
"
placeholder=
"P
assword"
/>
<button
type=
"submit"
class=
"fadein fourth"
value=
"Log In"
>
Submit
</button>
</form>
<div
class=
"fadein third"
>
New to ChatChat?
<nuxt-link
to=
"/register"
>
Create an account.
</nuxt-link>
</div>
<!-- Remind Passowrd -->
<!--
<div
id=
"formFooter"
>
<a
class=
"underlineHover"
href=
"#"
>
Forgot Password?
</a>
...
...
@@ -44,13 +49,29 @@ export default {
data
()
{
return
{
checkLogin
:
true
,
username
:
''
,
email
:
''
,
password
:
''
,
error
:
null
,
}
},
methods
:
{},
methods
:
{
onSubmit
()
{
this
.
$axios
.
$post
(
'https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=AIzaSyA0qXrqxpNc5FuQ_PE9D2bE4nlmPTuFAnc'
,
{
email
:
this
.
email
,
password
:
this
.
password
,
returnSecureToken
:
true
,
}
)
.
then
((
result
)
=>
{
alert
(
'Login Success !'
)
// window.location.href = '/'
})
},
},
}
</
script
>
...
...
pages/register/index.vue
View file @
202af87d
...
...
@@ -14,7 +14,7 @@
type=
"text"
class=
"fadein second"
name=
"email"
placeholder=
"
e
mail"
placeholder=
"
E
mail"
/>
<input
id=
"password"
...
...
@@ -22,7 +22,7 @@
type=
"password"
class=
"fadein third"
name=
"password"
placeholder=
"
p
assword"
placeholder=
"
P
assword"
/>
<input
id=
"repassword"
...
...
@@ -30,7 +30,7 @@
type=
"password"
class=
"fadein third"
name=
"repassword"
placeholder=
"
re
Password"
placeholder=
"
Re
Password"
/>
<button
type=
"submit"
class=
"fadein fourth"
value=
"Log In"
>
Submit
...
...
@@ -40,6 +40,9 @@
<!--
<div
id=
"formFooter"
>
<a
class=
"underlineHover"
href=
"#"
>
Forgot Password?
</a>
</div>
-->
<div
class=
"fadein third"
>
Have your account? Login
<nuxt-link
to=
"/login"
>
here
</nuxt-link>
</div>
</div>
</div>
<div
v-else
>
TEST
</div>
...
...
@@ -48,8 +51,6 @@
<
script
>
export
default
{
name
:
'Login'
,
layout
:
'clean'
,
data
()
{
return
{
checkLogin
:
true
,
...
...
@@ -80,6 +81,7 @@ export default {
window
.
location
.
href
=
'/'
})
}
else
{
alert
(
"repassword don't match with password"
)
}
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment