Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A user authentication solution for Mantra applications

License

NotificationsYou must be signed in to change notification settings

remotebase/meteor-auth

Repository files navigation

A user authentication solution for Mantra applications

Installation

npm install -s meteor-auth

Usage

This module includes:

  • authComposer
  • EnsureLoggedIn

authComposer

Compose a component withauthComposer usingcomposeWithTracker. Thecomponent will reactively receiveloggedIn andloggingIn props.

container

import{composeAll,composeWithTracker}from'mantra-core';importMyComponentfrom'../components/my_component.jsx';import{authComposer}from'meteor-auth';// ...returncomposeAll(composeWithTracker(authComposer),)(MyComponent);

component

importReactform'react'constMyComponent=({loggedIn, loggingIn})=>({loggedIn ?<div>Welcome</div> :loggingIn ?<div>Loading...</div> :<div>Please log in</div>});

EnsureLoggedIn

Wrap a content with<EnsureLoggedIn> to make sure only logged in users cansee the content.

importReactform'react'import{EnsureLoggedIn}from'meteor-auth';constMyComponent=()=>(<EnsureLoggedIn><div>Welcome</div></EnsureLoggedIn>);

props

unauthenticatedMessage

  • type: React component
  • Replace the default component displayed when user is not logged in
  • example:
constDashboard=()=>(<EnsureLoggedInunauthenticatedMessage={NotLoggedInMessage}><DashboardView/></EnsureLoggedIn>);constNotLoggedInMessage=(<div>    Please login.<ahref="/">Go back to the main page</a>.</div>);

Production ready

We are usingmeteor-auth inRemoteBase to serveactual users.

License

MIT

About

A user authentication solution for Mantra applications

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp