User not redirecting after admin login in SonataAdmin

2,213 views
Skip to first unread message

Babban

unread,
Jan 16, 2012, 12:47:50 PM1/16/12
to sonata-users
When i got to /admin/login and enter details and after successful
login i get the same login page but i am logged in. I am not being
redirected to /admin/dashboard

I have this security.yml

admin:
pattern: /admin(.*)
form_login:
provider: fos_userbundle
login_path: /admin/login
use_forward: false
check_path: /admin/login_check
failure_path: /admin/login
use_referer: true
default_target_path: /admin/dashboard
logout:
path: /admin/logout
target: /admin/login

anonymous: true

Grzegorz Floryański

unread,
Jan 16, 2012, 3:08:06 PM1/16/12
to sonata...@googlegroups.com
I have such confguration in my config and it works well.

main:
            pattern:      .*
            form-login:
                provider:       fos_userbundle
                login_path:     /admin/login
                use_forward:    false
                check_path:     /admin/login_check
                failure_path:   null

Babban

unread,
Jan 16, 2012, 3:10:03 PM1/16/12
to sonata-users
i dont know why that didn't worked but if i add this line then it
worked

always_use_default_target_path: true

Do u have that line as well

Grzegorz Floryański

unread,
Jan 17, 2012, 2:50:16 AM1/17/12
to sonata...@googlegroups.com
no i haven't..

Qrizly

unread,
Jan 17, 2012, 2:15:55 PM1/17/12
to sonata-users
The default settings worked for me.
If you assign a "ROLE_ADMIN" to the user, then after login you will be
forwarded to the /admin/dashboard

On 17 jan, 08:50, Grzegorz Floryański <grzegorz.floryan...@gmail.com>
wrote:
> no i haven't..

rsist...@gmail.com

unread,
Jul 20, 2016, 11:56:32 AM7/20/16
to sonata-users
That's not true. I tried assigning ROLE_ADMIN and ROLE_SONATA_ADMIN and it didn't work.

Cassiano Tartari

unread,
Jul 20, 2016, 12:13:03 PM7/20/16
to sonata-users
Recheck your firewalls under security.yml + routing.yml because you could not be loading sonata/fosuser routes or maybe using wrong provider.

You can compare with sonata sandbox files: security.yml and routing.yml

Att.,
Cassiano Tartari

--
You received this message because you are subscribed to the Google Groups "sonata-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonata-users...@googlegroups.com.
To post to this group, send email to sonata...@googlegroups.com.
Visit this group at https://groups.google.com/group/sonata-users.
For more options, visit https://groups.google.com/d/optout.

Simon Ball

unread,
Jul 23, 2016, 2:17:14 AM7/23/16
to sonata-users

From command line, promote the user to super admin.
If that works, then the problem is user roles assignment.
If it doesn't, check your routes, are they being imported properly?
Reply all
Reply to author
Forward
0 new messages