rgiladi / accounts-react Goto Github PK
View Code? Open in Web Editor NEWSimple and intuative accounts view layer for react in meteor
Home Page: https://react-accounts-demo.herokuapp.com/
Simple and intuative accounts view layer for react in meteor
Home Page: https://react-accounts-demo.herokuapp.com/
I was unable to install meteoreact:semantic-ui
as it's called in the readme, but meteor add meteoreact:accounts-semantic
worked. I noticed that meteoreact:unstyled-ui
should also be renamed to meteoreact:accounts-unstyled
.
Hi,
I have happily started using this great package, helping us to fully embrace react in the meteor world. Many thanks for creating and sharing it!
What puzzles me ist the missing resend verification link. I can`t find it anywhere.
Could you please tell me in which use-case it should be displayed? TIA
Anything useful can be added.
Few ideas from the original package are auto trim/lowercase/uppercase and a custom transform function to be applied on fields values
I'm struggling with the ReactRouter integration. It works fine for normal <Link>
s, so the router seems to be setup correctly. However, routing does not work in combination with the accounts components.
For instance, if the user logs in, nothing visible happens; the login dialog is still visible. However, if I reload the page, the root route is being shown. If I call Meteor.logout(), the user is being logged out, but the login dialog does not show up. Only if I reload the page, the login dialog will be rendered.
What may be wrong here? I'm using the latest version of ReactRouter, v4.
Hi,
I tested the package with this code :
import React, { Component } from 'react'
import { Redirect } from 'react-router'
import { Route, Switch } from 'react-router-dom'
import { AccountsReactComponent } from 'meteor/meteoreact:accounts'
class Authentication extends Component {
render () {
const arState = this.arState
return (
<Switch>
<Route exact path='/sign-in' component={arState} />
<Route exact path='/sign-up' component={arState} />
<Route exact path='/forgot-password' component={arState} />
<Route exact path='/change-password' component={arState} />
<Route exact path='/reset-password/:token' component={arState} />
<Route exact path='/resend-verification' component={arState} />
</Switch>
)
}
arState = ({ match, history }) => {
const { path, params } = match
// Cant change password if not logged in.
if (Meteor.userId() && path !== '/change-password') {
return (<Redirect to='/' />)
}
return (
<AccountsReactComponent
history={history}
route={path}
token={params.token} // for the reset-password route
/>
)
}
}
export default Authentication
I tired to log in and sign up, but when I go to the url /change-password, it does not show anything. Do I miss something ?
on meteor add meteoreact:accounts
it hangs at “Selecting package versions /”.
Process is eventually auto-killed after some time.
cat .meteor/release
=> [email protected]
tried meteor reset
and clearing .meteor directory but still same issue. I can't update meteor to newer version due to some incompatible packages.
Other packages can be added correctly.
In the given example
return (
<AccountsReactComponent
history={history}
route={path}
token={params.token} // for the reset-password route
/>
)
when path is '/reset-password/:token', it does not route accordindly as it is not one of the valid state
this allows to get rid of /:token
route={path.indexOf('/reset-password') !== -1 ? '/reset-password' : path}
Maybe you can change AccountsReactComponent (not easy on first look) or just update the example ?
Also I noticed that it is not mentionned to add this code on server side
import { Meteor } from 'meteor/meteor';
import { Accounts } from 'meteor/accounts-base';
Accounts.urls.resetPassword = function (token) {
return Meteor.absoluteUrl('reset-password/' + token);
};
I know this package is not maintained anymore, but I'd like to suggest a minor change: updating (or removing) the hard dependency on [email protected]
:
https://forums.meteor.com/t/reactmeteorcomponent-and-react-16-11/51505/5
Reason: Recent React versions have renamed some of the lifecycle hooks an throw warnings on the console. [email protected]
fixes this. That's the only diff between 0.2.16 and 1.0.0. But due to the hard dependency of this accounts package on the 0.2.16
, I can't update.
Is there any chance to either set the dependency to 1.0.0 or completely remove the version number?
It's very difficult to use this package without a clear example repo of this working. I'm having a hard time getting this set up at all. It seems that whenever the button is clicked in the form, it refreshes the page.
Implementation must provide support for one or multiple removes at once (Like with the "addFields" method)
Hi, I'm trying to get this package to work with a simple app I'm making.
So far, I've run the install commands:
meteor add meteoreact:accounts meteor add meteoreact:accounts-semantic
Here are relevent snippets of code I'm using:
import AccountsReactComponent from 'meteor/meteoreact:accounts-semantic' ... <AccountsReactComponent state='signUp' />
Here is the full error message I'm getting:
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object. Check the render method of 'NavbarA'. in NavbarA (created by App)
I'm trying to get a Modal popup (using React-Bootstrap) to display the sign-up page from this package.
I'm still having troubles setting routing up correctly.
If the user successfully logs in or out, there is no automatic forward to another page. I managed to workaround this for logins by setting the onLoginHook.
However, there is no equivalent onRegisterHook.
So, I am scratching my head how I can automatically forward the user in this case?
Support more packages like (but not only)
This functionality should help solve a scenario where you want to use one of the default fields but to change one of its properties.
I was thinking on a direction of providing the ability to edit the field's array directly.
Another possibility is to take advantage of deepmerge's arrayMerge option and provide a simple algorithm that will merge arrays in a way the we can do something like
AccountsReact.editFields('signUp', [
{
_id: 'password',
maxLength: 72
}
])
Thanks for this package. I'm trying to figure out how I can setup the accounts system so the username can be used instead of the e-mail for login? I couldn't find a way to do this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.