Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-060
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-060
2021-060
Commits
4f072714
Commit
4f072714
authored
Sep 17, 2021
by
Dhananjaya Jayashanka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update login form
parent
21aeb9ff
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
2 deletions
+73
-2
UI/form.js
UI/form.js
+60
-0
UI/index.html
UI/index.html
+0
-0
UI/login.html
UI/login.html
+13
-2
No files found.
UI/form.js
0 → 100644
View file @
4f072714
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
var
firebaseConfig
=
{
apiKey
:
"
AIzaSyBhnLZA8NKFBEOojrjK27sVVO_z6H1EDKE
"
,
authDomain
:
"
speech-master-login.firebaseapp.com
"
,
projectId
:
"
speech-master-login
"
,
storageBucket
:
"
speech-master-login.appspot.com
"
,
messagingSenderId
:
"
1055856699477
"
,
appId
:
"
1:1055856699477:web:cd5cc6c7e341000a828cdc
"
,
measurementId
:
"
G-L8DLH18DG8
"
};
// Initialize Firebase
firebase
.
initializeApp
(
firebaseConfig
);
const
auth
=
firebase
.
auth
();
//signup function
function
signUp
(){
var
email
=
document
.
getElementById
(
"
email
"
);
var
password
=
document
.
getElementById
(
"
password
"
);
const
promise
=
auth
.
createUserWithEmailAndPassword
(
email
.
value
,
password
.
value
);
promise
.
catch
(
e
=>
alert
(
e
.
message
));
alert
(
"
SignUp Successfully
"
);
}
//signIN function
function
signIn
(){
var
email
=
document
.
getElementById
(
"
email
"
);
var
password
=
document
.
getElementById
(
"
password
"
);
const
promise
=
auth
.
signInWithEmailAndPassword
(
email
.
value
,
password
.
value
);
promise
.
catch
(
e
=>
alert
(
e
.
message
));
alert
(
"
SignUp In Successfully
"
+
email
);
}
//signOut
function
signOut
(){
auth
.
signOut
();
alert
(
"
SignOut Successfully from System
"
);
}
//active user to homepage
firebase
.
auth
().
onAuthStateChanged
((
user
)
=>
{
if
(
user
){
var
email
=
user
.
email
;
alert
(
"
Active user
"
+
email
);
}
else
{
alert
(
"
No Active user Found
"
)
}
})
\ No newline at end of file
UI/
Home
.html
→
UI/
index
.html
View file @
4f072714
File moved
UI/login.html
View file @
4f072714
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
<html
lang=
"en"
>
<html
lang=
"en"
>
<head>
<head>
<meta
charset=
"utf-8"
/>
<meta
charset=
"utf-8"
/>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
content=
"width=device-width, initial-scale=1.0"
name=
"viewport"
/>
<meta
content=
"width=device-width, initial-scale=1.0"
name=
"viewport"
/>
<title>
Login
</title>
<title>
Login
</title>
...
@@ -98,6 +99,12 @@
...
@@ -98,6 +99,12 @@
<!-- Optional: include a polyfill for ES6 Promises for IE11 -->
<!-- Optional: include a polyfill for ES6 Promises for IE11 -->
<!--<script src="https://cdn.jsdelivr.net/npm/promise-polyfill"></script> -->
<!--<script src="https://cdn.jsdelivr.net/npm/promise-polyfill"></script> -->
<script
src=
"lib/sweetalert2-9.15.2/package/dist/sweetalert2.min.js"
></script>
<script
src=
"lib/sweetalert2-9.15.2/package/dist/sweetalert2.min.js"
></script>
<!-- Db connection-->
<script
src=
"https://www.gstatic.com/firebasejs/8.2.7/firebase-app.js"
></script>
<script
src=
"https://www.gstatic.com/firebasejs/8.2.7/firebase-auth.js"
></script>
<script
src=
"form.js"
></script>
<link
<link
rel=
"stylesheet"
rel=
"stylesheet"
href=
"lib/sweetalert2-9.15.2/package/dist/sweetalert2.min.css"
href=
"lib/sweetalert2-9.15.2/package/dist/sweetalert2.min.css"
...
@@ -161,7 +168,7 @@
...
@@ -161,7 +168,7 @@
<!-- Email -->
<!-- Email -->
<input
<input
type=
"email"
type=
"email"
id=
"
defaultLoginFormE
mail"
id=
"
e
mail"
class=
"form-control mb-4"
class=
"form-control mb-4"
placeholder=
"E-mail"
placeholder=
"E-mail"
/>
/>
...
@@ -169,7 +176,7 @@
...
@@ -169,7 +176,7 @@
<!-- Password -->
<!-- Password -->
<input
<input
type=
"password"
type=
"password"
id=
"
defaultLoginFormP
assword"
id=
"
p
assword"
class=
"form-control mb-4"
class=
"form-control mb-4"
placeholder=
"Password"
placeholder=
"Password"
/>
/>
...
@@ -201,6 +208,10 @@
...
@@ -201,6 +208,10 @@
Sign in
Sign in
</button></a> -->
</button></a> -->
<button
onclick=
"signUp()"
id=
"signUp"
>
SignUp
</button>
<button
onclick=
"signIn()"
id=
"signIp"
>
SignIn
</button>
<button
onclick=
"signOut()"
id=
"signOut"
>
SignOut
</button>
<a
<a
href=
"fileUploaderFinal.html"
href=
"fileUploaderFinal.html"
class=
"btn btn-info btn-block my-4"
class=
"btn btn-info btn-block my-4"
...
...
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