Can you share the code for the user function in default.py?

How do you know that the session timed out?

Jim


On Wed, May 6, 2020, 5:58 PM Maurice Waka <[email protected]> wrote:

> After clicking the login, that's when the error comes in.
> No I haven't set the timer. I left the same time length in default.
> Kind regards
>
> On Wed, May 6, 2020 at 3:58 PM Jim S <[email protected]> wrote:
>
>> You said you notice this message after a period of inactivity, but you
>> also say this message comes up after clicking login.  What is telling you
>> that this is happening after a period of inactivity?
>>
>> I was hoping to see what you have for default/user/load (which you
>> referenced above) - load is not a built-in function in default/user that
>> I'm aware of.
>>
>> Here is the normal default/user signature:
>>
>>
>> def user():
>>     """
>>     exposes:
>>     http://..../[app]/default/user/login
>>     http://..../[app]/default/user/logout
>>     http://..../[app]/default/user/register
>>     http://..../[app]/default/user/profile
>>     http://..../[app]/default/user/retrieve_password
>>     http://..../[app]/default/user/change_password
>>     use @auth.requires_login()
>>         @auth.requires_membership('group name')
>>         @auth.requires_permission('read','table name',record_id)
>>     to decorate functions that need access control
>>     """
>>
>> So I was thinking you had put something custom in there.
>>
>> Are you able to force it to happen by setting your
>> auth.settings.expiration to a low number of seconds?
>>
>> -Jim
>>
>>
>> On Wednesday, May 6, 2020 at 12:11:55 AM UTC-5, Maurice Waka wrote:
>>>
>>> Actually, I want to customize the code to get better feedback, and after
>>> digging in I got this discussion
>>> <https://groups.google.com/forum/#!searchin/web2py/not$20authorized$20message%7Csort:date/web2py/k-FnX_X6CcI/fqgUpRbwAwAJ>
>>>
>>> I just don't know where to exactly place this code, or get something
>>> better:
>>>
>>> auth.messages.ajax_failed_authentication = DIV(H4(T('Your session has 
>>> expired')),
>>>                             T('Please '),
>>>                             A(T('login'),
>>>                               _href=auth.settings.login_url +
>>>                                     ('?_next=' + 
>>> urllib.quote(request.env.http_web2py_component_location))
>>>                               if request.env.http_web2py_component_location 
>>> else ''),
>>>                             T(' again to view this content.'),
>>>                             _class='not-authorized alert alert-block')
>>>
>>>
>>>
>>> On Tue, May 5, 2020 at 11:09 PM Jim S <[email protected]> wrote:
>>>
>>>> Can you show some code?
>>>>
>>>> -Jim
>>>>
>>>> On Tuesday, May 5, 2020 at 1:38:29 PM UTC-5, Maurice Waka wrote:
>>>>>
>>>>> I notice this message after a period of inactivity. See attached.
>>>>> The problem is that on clicking on the login link on the app on
>>>>> pythonanywhere, I get an error: invalid view (default/user/load).
>>>>> How can I resolve this?
>>>>> Regards
>>>>>
>>>> --
>>>> Resources:
>>>> - http://web2py.com
>>>> - http://web2py.com/book (Documentation)
>>>> - http://github.com/web2py/web2py (Source code)
>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>> ---
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "web2py-users" group.
>>>> To unsubscribe from this topic, visit
>>>> https://groups.google.com/d/topic/web2py/Px0b1zYX-Zg/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/web2py/541b05b3-02b7-4bc8-8773-f093a41bc1ce%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/web2py/541b05b3-02b7-4bc8-8773-f093a41bc1ce%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/web2py/Px0b1zYX-Zg/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/web2py/badaa3f7-1281-412d-81a0-6b053adb8040%40googlegroups.com
>> <https://groups.google.com/d/msgid/web2py/badaa3f7-1281-412d-81a0-6b053adb8040%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/Px0b1zYX-Zg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/CALkNK54dFiuG9YNKyLw5%3DeGQCZx7%2ByacSk%3Dn-aMLtjcOAq1yGQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/web2py/CALkNK54dFiuG9YNKyLw5%3DeGQCZx7%2ByacSk%3Dn-aMLtjcOAq1yGQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAERBpoAMzpD-71c4AOf_r5Yo18oFNdyjkONep%2BENpvrFM0G6JQ%40mail.gmail.com.

Reply via email to