DJForm Login Help!

Joined
Jun 14, 2018
Messages
107
Reaction score
1
i've created a loginform.html and loginform.js

i'm using firebase as the database so in short

firebase is setup!

html form is done

so is loginform.js

BUT when i go and test the login form nothing happens?

i'v inspected element got this error

Uncaught SyntaxError: Unexpected token '}' (at loginform.js:2:292)

content.js:1 Phisherman loaded... loginform.js:2

now the html i got is

HTML:
<html>
<head>
<title> Login Page </title>
<script src="https://www.gstatic.com/firebasejs/8.6.3/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.6.3/firebase-auth.js"></script>
<script src="https://coolvibes-reloaded.com/ReqForm/loginform.js"> </script>
    <link href="https://coolvibes-reloaded.com/ReqForm/style.css" rel="stylesheet" />


</head>
<body>
<div id="form">
<h1> DJ Portal </h1>
<div id="header"> </div>

<input type="email" placeholder="Enter Email" id="email"/>
    <input type="password" placeholder="Enter Password" id="password"/>


<button onclick="signIn()" id="signIn"> Sign In </button>

<a href="https://coolvibes-reloaded.com/ReqForm/ReqQue/display.html"> Check out the current queue </a> <br/><br/>
    <a href="https://coolvibes-reloaded.com/ReqForm/form.html"> Song Form  </a>

</div>

</body>

</html>
the JS script:

JavaScript:
// Your web app's Firebase configuration
  var firebaseConfig = {
    apiKey: "myapi",
  authDomain: "myauth",
  projectId: "myid",
  storageBucket: "my storage bucket",
  messagingSenderId: "senderid",
  appId: "appid",
  };
  // Initialize Firebase
  firebase.initializeApp(firebaseConfig);

const auth = firebase.auth();


function signIn() {
  var email = document.getElementById("email").value;
  var password = document.getElementById("password").value;

  firebase.auth().signInWithEmailAndPassword(email, password)
    .then((userCredential) => {
      // Signed in
      alert("Signed in successfully!");
    })
    .catch((error) => {
      alert("Error: " + error.message);
    });
}

  var email = document.getElementById("email");
  var password = document.getElementById("password");

  const promise = auth.signInWithEmailAndPassword(email.value, password.value);
  promise.then(() => location.replace(".https://coolvibes-reloaded.com/ReqForm/ReqQue/djqueue.html")).catch(e => alert(e.message));


};

function signOut(){
  auth.signOut();
  location.replace(".https://coolvibes-reloaded.com/ReqForm/loginform.html");
  alert("Signed Out")
}


});
now obviously i have all my creds in this script from firebase but didn't want to show them for privacy concern. i have debuged but still nothing..... button isn't even signing in
 
Joined
Jul 4, 2023
Messages
466
Reaction score
57
Uncaught SyntaxError: Unexpected token '}'
1727692321568.png



BTW, check this:
JavaScript:
// Your web app's Firebase configuration
var firebaseConfig = {
  apiKey: "myapi",
  authDomain: "myauth",
  projectId: "myid",
  storageBucket: "my storage bucket",
  messagingSenderId: "senderid",
  appId: "appid",
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);

const auth = firebase.auth();

function signIn() {
  var email = document.getElementById("email").value;
  var password = document.getElementById("password").value;

  firebase.auth().signInWithEmailAndPassword(email, password)
    .then((userCredential) => {
    // Signed in
    alert("Signed in successfully!");
    location.replace("https://coolvibes-reloaded.com/ReqForm/ReqQue/djqueue.html")
  })
    .catch((error) => {
    alert("Error: " + error.message);
  });
}

function signOut() {
  auth.signOut();
  location.replace("https://coolvibes-reloaded.com/ReqForm/loginform.html");
  alert("Signed Out")
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,930
Messages
2,570,072
Members
46,522
Latest member
Mad-Ram

Latest Threads

Top