- Notifications
You must be signed in to change notification settings - Fork7
A user authentication solution for Mantra applications
License
NotificationsYou must be signed in to change notification settings
remotebase/meteor-auth
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A user authentication solution for Mantra applications
npm install -s meteor-auth
This module includes:
authComposer
EnsureLoggedIn
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>});
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>);
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>);
We are usingmeteor-auth
inRemoteBase to serveactual users.
MIT
About
A user authentication solution for Mantra applications
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.