-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
65 lines (59 loc) · 1.59 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html>
<html>
<head>
<title>migrate to firebase</title>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
<button @click="btnCreateUser()">create user w/ mail&pass</button><br>
{{count}}<br>
open js console
</div>
<script src="https://www.gstatic.com/firebasejs/3.9.0/firebase.js"></script>
<script>
const config = {
// paste your firebase snippet
apiKey: "",
authDomain: "",
databaseURL: "",
projectId: "",
storageBucket: "",
messagingSenderId: ""
}
const auth = firebase.initializeApp(config).auth()
new Vue({
el: '#app',
data: {
count: 0,
mailindex: 0, // column number where mail is
passindex: 1, // column number where password is
CSV: [
// paste your modified CSV
// example:
// ['[email protected]','password', ... ],
// ['[email protected]','password2', ... ]
],
},
methods: {
createUser(mail, pass) {
const promise = auth.createUserWithEmailAndPassword(mail, pass);
promise.then(() => {
console.log('created', mail)
},(error) => {
const message = error.message
console.log(message)
console.log(error)
})
},
btnCreateUser() {
const li = this.CSV
console.log(this.count, ' / ', li.length)
this.createUser(li[this.count][this.mailindex], li[this.count][this.passindex])
this.count++
},
}
})
</script>
</body>
</html>