ተጠቃሚዎችን መጨመር

6

የተተረጎመው መጠን

በዚህ ምዕራፍ:

  • ስለሚትዩር የተጠቃሚ መለያ ይማሩ።
  • ለማይክሮስኮፐ የሚያስፈልገንን ማረጋገጫ በሙሉ እንጨምር።
  • ውስጥሠር የሆነውን ኣካውንትስ-ዩኣይን (accounts-ui) በመጠቀም በፍጥነት የተጠቃሚ ኣዋዋይ እንሥራ።
  • ////

    ////

    ////

    መለያዎች: ተጠቃሚዎችን በቀላሉ

    ////

    ////

    ////

    $ mrt add accounts-ui-bootstrap-dropdown
    $ mrt add accounts-password
    
    Terminal

    ////

    ////

    <template name="layout">
      <div class="container">
        {{>header}}
        <div id="main" class="row-fluid">
          {{yield}}
        </div>
      </div>
    </template>
    
    client/views/application/layout.html
    <template name="header">
      <header class="navbar">
        <div class="navbar-inner">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="{{pathFor 'postsList'}}">Microscope</a>
          <div class="nav-collapse collapse">
            <ul class="nav pull-right">
              <li>{{loginButtons}}</li>
            </ul>
          </div>
        </div>
      </header>
    </template>
    
    client/views/includes/header.html

    ////

    Meteor's built-in accounts UI
    Meteor’s built-in accounts UI

    ////

    ////

    Accounts.ui.config({
      passwordSignupFields: 'USERNAME_ONLY'
    });
    
    client/helpers/config.js

    ኣከማች 6-1

    Added accounts and added template to the header

    የመጀመሪያ ተጠቃሚያችንን መፍጠር

    ////

    ////

     Meteor.users.findOne();
    
    Browser console

    ////

    ////

     Meteor.users.find().count();
    1
    
    Browser console

    ////

    ////

    > db.users.count()
    2
    
    Mongo console

    ////

    ሚስጥራዊ ስርጭት!

    ////

    ////

    ////

    ////

    ////

    ////

    > db.users.findOne()
    {
      "createdAt" : 1365649830922,
      "_id" : "kYdBd9hr3fWPGPcii",
      "services" : {
        "password" : {
          "srp" : {
            "identity" : "qyFCnw4MmRbmGyBdN",
            "salt" : "YcBjRa7ArXn5tdCdE",
            "verifier" : "df2c001edadf4e475e703fa8cd093abd4b63afccbca48fad1d2a0986ff2bcfba920d3f122d358c4af0c287f8eaf9690a2c7e376d701ab2fe1acd53a5bc3e843905d5dcaf2f1c47c25bf5dd87764d1f58c8c01e4539872a9765d2b27c700dcdedadf5ac82521467356d3f91dbeaf9848158987c6d359c5423e6b9cabf34fa0b45"
          }
        },
        "resume" : {
          "loginTokens" : [
            {
              "token" : "BMHipQqjfLoPz7gru",
              "when" : 1365649830922
            }
          ]
        }
      },
      "username" : "tmeasday"
    }
    
    Mongo console

    ////

     Meteor.users.findOne();
    Object {_id: "kYdBd9hr3fWPGPcii", username: "tmeasday"}
    
    Browser console

    ////

    ////