Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect after sign in #381

Open
CrazyClicker opened this issue Aug 27, 2015 · 4 comments
Open

Redirect after sign in #381

CrazyClicker opened this issue Aug 27, 2015 · 4 comments

Comments

@CrazyClicker
Copy link

Hello guys!

I'm using custom function to check login on Router.onBeforeAction, with the following code

    ...
    Session.set('fromWhere', router.url);
    Router.go('/sign-in');
    Session.set('entryError', 'Error.');
    router.next();
    ...

But I keep getting redirected to '/dashboard' url after signing in, no matter what page I was trying to reach.
Any suggestions?

@txs
Copy link

txs commented Sep 4, 2015

This is my workaround I pass the current url in this Session.set('fromWhere1', Router.current().url);
and then get the value to Session fromWhere in order to pass the url

@txs
Copy link

txs commented Sep 4, 2015

you have to pass back in the afteraction

@CrazyClicker
Copy link
Author

Thanks for the reply!
But, honestly, I didn't really got the idea as well as I don't get problem with fromWhere session param.
Didn't find an easy way to debug meteor plugins, but I've read source code and couldn't find any reasons it shouldn't work...

@txs
Copy link

txs commented Sep 8, 2015

the problem is fromWhere data will be set to undefined when in sign-in page
so the redirect will fail. And the method I use is to put in a different
session. After the undefined is loaded I put that session and replace it on
the afteraction hook.

On Mon, Sep 7, 2015 at 5:32 PM, CrazyClicker [email protected]
wrote:

Thanks for the reply!
But, honestly, I didn't really got the idea as well as I don't get problem
with fromWhere session param.
Didn't find an easy way to debug meteor plugins, but I've read source code
and couldn't find any reasons it shouldn't work...


Reply to this email directly or view it on GitHub
#381 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants