diff options
| author | Rubén Beltrán del Río <ben@nsovocal.com> | 2017-01-30 02:47:14 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-30 02:47:14 -0600 |
| commit | a6ccda0fbc4df683f9568d85eb22b21684d2a0bd (patch) | |
| tree | 967e98f2d8bf6718858da1fbc279987208b25e06 /app/components/welcome.js | |
| parent | 287fa13b3e600b2340895a5463a288bf08101bb5 (diff) | |
Create and Show Posts (#3)
* 📝 Update changelog (retroactive)
SORRY
* Add JSDoc
* Document twitter helper
* Add posts handler
* Remove cookies, set routes under /api
* Update readme for clearer callback instructions
* Redirect callback to login with token
* Add dasein paw helper
* Remove unused hostname
* Remove hostname, add expiration to config
* Rename expiration ttl
* Send TTL to posts handler
* Add redis dependency
* Add redis config to config file
* Add DASEIN_REDIS_HOST to env.dist
* Correct redis config structure
* Add redis db to compose
* Add redis to posts handler
* Update dasein paw file
* Git add uuid
* Add first iteration of post handlers
* Ignore docs in linter
* Ignore generated assets
* Ignore docs and assets
* Add frontend dependencies + more koa
* Add post creation to backend
* Adjust readme to show actual callback route
* Add npm build as part of docker process
* Configure babel
* Update paw
* Add webpack config
* Add frontend code
* List globals
Diffstat (limited to 'app/components/welcome.js')
| -rw-r--r-- | app/components/welcome.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/app/components/welcome.js b/app/components/welcome.js new file mode 100644 index 0000000..4fcee0f --- /dev/null +++ b/app/components/welcome.js @@ -0,0 +1,39 @@ +import Vue from 'vue'; +import AuthService from '../services/auth'; + +/* global window */ + +const internals = {}; + +export default internals.WelcomeComponent = Vue.component('welcome', { + template: '<div class="welcome-container">' + + '<p>{{message}}</p>' + + '<a href="#" v-on:click=initiateLogin v-if=!loggingIn>Login</a>' + + '</div>', + + data() { + + return { + message: 'Welcome to Dasein, a social network with posts that disappear when the conversation stops', + loggingIn: false, + authService: new AuthService() + }; + }, + + methods: { + initiateLogin() { + + this.message = 'Logging you in...'; + this.loggingIn = true; + + this.authService.initiateLogin().then((authData) => { + + window.location.href = authData.loginUrl; + }).catch((err) => { + + console.error(err); + this.message = 'Oh no! There was a problem logging you in.'; + }); + } + } +}); |