[Grok-dev] Unauthorized, but only on the upgraded Grok project
Sebastian Ware
sebastian at urbantalk.se
Sun Oct 4 08:31:13 EDT 2009
I only get the error when I do a successful login if that is any help.
The offending code causing [Unauthorised] should be:
> if (not IUnauthenticatedPrincipal.providedBy(self.request.principal)
> and login_submit is not None):
> destination = self.request.get('referer')
> if not destination:
> destination = self.url(grok.getSite()) + '/default/
> workflow'
> else:
> destination = unquote(destination)
> self.redirect(destination)
Mvh Sebastian
On 4 okt 2009, at 13.40, Sebastian Ware wrote:
> I created a project with
>
> grok = 1.0a4
>
> and it works well. Now I have deployed the same project with a fresh
>
> grok = 1.0b2
>
> and I am getting [Unauthorized]. When I am trying to log in through my
> custom login view. I can reach the login view but [Unauthorized] seems
> to be thrown when I post my login data. I read the comment on
> <grant permission="zope.View" principal="zope.Anybody" />
> but I am under the impression that this isn't related to my problem.
>
> I am not getting any entries in access.log, and obviously no errors,
> so I don't really know how to track down this problem. Especially
> since it works fine in my development setup.
>
> I can't reach any other views of my app except the login view. This is
> the login code.
>
> class Login(grok.View):
> grok.context(ProtonCMS)
> title = 'Logga in'
>
> referer = None
>
> def update(self, login_submit=None, login=None):
> # XXX: need to display some kind of feedback when the login
> fails
> self.the_url, self.the_args = self.get_url_and_args()
> if (not
> IUnauthenticatedPrincipal.providedBy(self.request.principal)
> and login_submit is not None):
> destination = self.request.get('referer')
> if not destination:
> destination = self.url(grok.getSite()) + '/default/
> workflow'
> else:
> destination = unquote(destination)
> self.redirect(destination)
> else:
> if self.the_args.has_key('camefrom'):
> self.referer = self.the_args['camefrom']
>
> Any ideas?
>
> Mvh Sebastian
>
>
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> https://mail.zope.org/mailman/listinfo/grok-dev
More information about the Grok-dev
mailing list