mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-18 19:58:52 +00:00
username/password registration now available
This commit is contained in:
parent
7f8ae420aa
commit
07a614259f
3 changed files with 19 additions and 4 deletions
|
|
@ -28,7 +28,7 @@
|
|||
"www.habitrpg.com"
|
||||
],
|
||||
"scripts": {
|
||||
"start": "server.js"
|
||||
"start": "node server.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "0.8.x",
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ derby = require 'derby'
|
|||
{get, view, ready} = derby.createApp module
|
||||
derby.use require 'derby-ui-boot'
|
||||
derby.use require('../../ui')
|
||||
derby.use require('derby-auth/components');
|
||||
|
||||
# Custom requires
|
||||
moment = require('moment')
|
||||
|
|
@ -39,9 +40,10 @@ get '/:uid?', (page, model, {uid}, next) ->
|
|||
#FIXME remove this eventually, part of user schema
|
||||
user.setNull 'balance', 2
|
||||
# support legacy Everyauth schema (now using derby-auth, Passport)
|
||||
fb = user.get('auth.facebook')
|
||||
if fb
|
||||
if fb = user.get('auth.facebook')
|
||||
model.set('_loginName', if fb._raw then "#{fb.name.givenName} #{fb.name.familyName}" else fb.name)
|
||||
else if username = user.get('auth.local.username')
|
||||
model.set('_loginName', username)
|
||||
|
||||
# Setup Item Store
|
||||
model.set '_items'
|
||||
|
|
|
|||
|
|
@ -13,7 +13,20 @@
|
|||
<div id="head">
|
||||
<div class='pull-right'>
|
||||
{#unless _loggedIn}
|
||||
<a href="/auth/facebook"><img src='/img/facebook-login-register.jpeg' alt="Login / Register With Facebook"/></a>
|
||||
<a class="btn btn-small btn-info" href="#login-modal" data-toggle="modal">Login / Register</a>
|
||||
|
||||
<app:myModal modalId="login-modal" header="Login / Register">
|
||||
<a href="/auth/facebook"><img src='/img/facebook-login-register.jpeg' alt="Login / Register With Facebook"/></a>
|
||||
<h3>Or</h3>
|
||||
<boot:tabs>
|
||||
<boot:tab title="Login">
|
||||
<derby-auth:login />
|
||||
</boot:tab>
|
||||
<boot:tab title="Register">
|
||||
<derby-auth:register />
|
||||
</boot:tab>
|
||||
</boot:tabs>
|
||||
</app:myModal>
|
||||
{else}
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-small">{_loginName}</button>
|
||||
|
|
|
|||
Loading…
Reference in a new issue