forked from cloudinary-devs/cloudybadge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Maya Shavin
committed
Feb 4, 2020
1 parent
f63e450
commit 2401780
Showing
14 changed files
with
308 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,3 +83,4 @@ dist | |
|
||
# Service worker | ||
sw.* | ||
now.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const nodemailer = require('nodemailer'); | ||
|
||
const transporter = nodemailer.createTransport({ | ||
service: 'gmail', | ||
auth: { | ||
user: process.env.EMAIL_USER, | ||
pass: process.env.EMAIL_KEY | ||
} | ||
}); | ||
|
||
const mailOptions = { | ||
from: process.env.EMAIL_USER, | ||
subject: 'Start editing your badge with CloudyBadge', | ||
text: 'Testing' | ||
}; | ||
|
||
module.exports = (user) => { | ||
const options = { | ||
...mailOptions, | ||
to: user.email, | ||
}; | ||
|
||
transporter.sendMail(options, (error, info) => { | ||
if (error) { | ||
console.log(error) | ||
} else { | ||
console.log('Email sent: ' + info.response); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default function ({ store, error }) { | ||
if (!store.state.authUser) { | ||
error({ | ||
message: 'You are not connected', | ||
statusCode: 403 | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<template> | ||
<div>Create Event</div> | ||
</template> | ||
<script> | ||
import { mapGetters } from 'vuex' | ||
export default { | ||
middleware: 'auth', | ||
computed: { | ||
...mapGetters(['loggedInUser']) | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<template> | ||
<section class="flex justify-center items-center"> | ||
<div class="max-w-sm flex flex-col"> | ||
<h1 class="my-3"> | ||
Welcome to CloudyBadge | ||
</h1> | ||
<div class="border-b-2 border-dashed w-1/6 self-center mt-3 mb-3" /> | ||
<form @submit.prevent="login" class="mt-5 text-center"> | ||
<div class="flex flex-col text-left"> | ||
<label for="email">Email</label> | ||
<input name="email" v-model="email" type="text" required class="p-3 border-b mt-2"/> | ||
</div> | ||
<div class="flex flex-col text-left mt-4"> | ||
<label for="password">Password</label> | ||
<input name="password" v-model="password" type="password" required class="p-3 border-b mt-2"/> | ||
</div> | ||
<button type="submit" class="button--green m-4">Login</button> | ||
</form> | ||
</div> | ||
</section> | ||
</template> | ||
<script> | ||
export default { | ||
data() { | ||
return { | ||
email: '', | ||
password: '', | ||
} | ||
}, | ||
methods: { | ||
async login(e) { | ||
const payload = { | ||
email: this.email, | ||
password: this.password, | ||
}; | ||
const response = await this.$auth.loginWith('local', { | ||
data: { | ||
email: this.email, | ||
password: this.password | ||
} | ||
}); | ||
if (!response.error) { | ||
this.$router.push(`/admin/${response.data.id}`); | ||
} else { | ||
this.$toast.error('Failed to log in.', { | ||
duration: 3000 | ||
}); | ||
} | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.