cubic-ui
UI node for Cubic.
Last updated a month ago by kaptard .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install cubic-ui 
SYNC missed versions from official npm registry.

cubic-ui

UI rendering node and server for Cubic.

npm build dependencies



Scope authentication

UI endpoints can be protected in the same way as regular API endpoints, via the this.schema.scope option, they also behave the same way (see cubic-api).

Creating a login system

Creating a login system is as simple as writing a POST form which targets the cubic-auth /authenticate endpoint with cookie_set set. Cubic-auth then sets a cookie which contains the user's access and refresh token. If you want to logout, simply remove the cookie and refresh the page.

Dealing with scoped api endpoints

Sometimes, you want to access a scoped API endpoint on a non-scoped UI endpoint. The default behaviour, when a non-authorized user connects, is to terminate the entire page like an entire endpoint would.
However, you still want to sometimes show the ui, with the scoped API content removed or edited. If you want to do something like that, add try/catch blocks in your asyncData hooks:

try {
    cubic.get('/scoped_api_endpoint')
} catch (err) {
    // Show alternative content
}

Current Tags

  • 3.4.0                                ...           latest (a month ago)

46 Versions

  • 3.4.0                                ...           a month ago
  • 3.3.0                                ...           4 months ago
  • 3.2.0                                ...           5 months ago
  • 3.1.10                                ...           5 months ago
  • 3.1.9                                ...           5 months ago
  • 3.1.8                                ...           6 months ago
  • 3.1.7                                ...           6 months ago
  • 3.1.6                                ...           7 months ago
  • 3.1.5                                ...           7 months ago
  • 3.1.4                                ...           7 months ago
  • 3.1.3                                ...           7 months ago
  • 3.1.2                                ...           7 months ago
  • 3.1.1                                ...           7 months ago
  • 3.1.0                                ...           7 months ago
  • 3.0.4                                ...           8 months ago
  • 3.0.3                                ...           8 months ago
  • 3.0.2                                ...           9 months ago
  • 3.0.1                                ...           9 months ago
  • 3.0.0                                ...           9 months ago
  • 2.0.7                                ...           10 months ago
  • 2.0.6                                ...           a year ago
  • 2.0.5                                ...           a year ago
  • 2.0.4                                ...           a year ago
  • 2.0.3                                ...           a year ago
  • 2.0.2                                ...           a year ago
  • 2.0.1                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 1.4.8                                ...           a year ago
  • 1.4.7                                ...           a year ago
  • 1.4.6                                ...           a year ago
  • 1.4.5                                ...           a year ago
  • 1.4.4                                ...           a year ago
  • 1.4.3                                ...           a year ago
  • 1.4.2                                ...           a year ago
  • 1.4.1                                ...           a year ago
  • 1.4.0                                ...           a year ago
  • 1.3.0                                ...           a year ago
  • 1.2.4                                ...           a year ago
  • 1.2.3                                ...           a year ago
  • 1.2.2                                ...           a year ago
  • 1.2.1                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (2)
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 126
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |