Skip to content

Commit

Permalink
v1.21.8 - Add user API
Browse files Browse the repository at this point in the history
  • Loading branch information
DispatchCommit committed Jun 25, 2020
1 parent f56bb82 commit 5ac9d13
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bitwave.tv",
"version": "1.21.7",
"version": "1.21.8",
"description": "An open platform live streaming service for creators to freely express themselves.",
"author": "Dispatch",
"scripts": {
Expand Down
23 changes: 14 additions & 9 deletions store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,15 +334,20 @@ export const actions = {
// Create user document
const userId = userCredential.user.uid;

await db
.collection( 'users' )
.doc( userId )
.set({
_username: credential.username.toLowerCase(),
uid: userId,
username: credential.username,
email: credential.email,
});
const token = await userCredential.user.getIdToken();
this.$axios.setToken( token, 'Bearer' );

const endpoint = `https://api.bitwave.tv/v1/user/create`;
const payload = { user: credential.username };
try {
const result = await this.$axios.post(
endpoint,
payload,
);
console.log( result.data );
} catch ( error ) {
console.error( error );
}

return true;
},
Expand Down

0 comments on commit 5ac9d13

Please sign in to comment.