[Bug] Clicking Sign Out but Still Logged In #5508

Closed
opened 2025-11-02 06:27:02 -06:00 by GiteaMirror · 11 comments
Owner

Originally created by @bagasme on GitHub (Jun 7, 2020).

  • Gitea version (or commit ref): 1.12.0+rc1 (compiled with Go 1.14.2, TAGS=bindata)
  • Git version: 2.26.2
  • Operating system: Debian 10
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist: paste.ubuntu.com

Description

Sign out from Gitea will instead keep the user logged in.

However, I didn't see any symptoms in the log gist I attached.

Firefox DevTools logged JS areYouSure errors and warnings, possibly related to the bug:

jQuery.Deferred exception: $(...).areYouSure is not a function @https://gitnode.io/js/index.js?v=9245442d00d25735b3aa4bc8621e29f9:1:188176
l@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:31032
a/</c<@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:31334
setTimeout handler*a/<@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:31543
u@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:29314
fireWith@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:30062
fire@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:30098
u@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:29314
fireWith@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:30062
ready@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:33048
_@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:32826
EventListener.handleEvent*304/<@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:33197
304/<@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:1149
304@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:1262
n@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:110
1012@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:1004
n@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:110
1011@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:947
n@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:110
@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:902
@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:914
 undefined jquery.js:1:32593
Uncaught TypeError: $(...).areYouSure is not a function
    <anonymous> index.js:2664
    jQuery 20
index.js:2664:33

The bug does not occured on 1.13.0+dev-62-g8443ca109 on my LXD development container.

Screenshots

gitea-bug

Originally created by @bagasme on GitHub (Jun 7, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.12.0+rc1 (compiled with Go 1.14.2, `TAGS=bindata`) - Git version: 2.26.2 - Operating system: Debian 10 - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: [paste.ubuntu.com](https://paste.ubuntu.com/p/hphF4N5NCv/) ## Description Sign out from Gitea will instead keep the user logged in. However, I didn't see any symptoms in the log gist I attached. Firefox DevTools logged JS `areYouSure` errors and warnings, possibly related to the bug: ``` jQuery.Deferred exception: $(...).areYouSure is not a function @https://gitnode.io/js/index.js?v=9245442d00d25735b3aa4bc8621e29f9:1:188176 l@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:31032 a/</c<@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:31334 setTimeout handler*a/<@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:31543 u@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:29314 fireWith@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:30062 fire@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:30098 u@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:29314 fireWith@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:30062 ready@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:33048 _@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:32826 EventListener.handleEvent*304/<@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:33197 304/<@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:1149 304@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:1262 n@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:110 1012@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:1004 n@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:110 1011@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:947 n@https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:110 @https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:902 @https://gitnode.io/js/jquery.js?v=9245442d00d25735b3aa4bc8621e29f9:1:914 undefined jquery.js:1:32593 ``` ``` Uncaught TypeError: $(...).areYouSure is not a function <anonymous> index.js:2664 jQuery 20 index.js:2664:33 ``` The bug does not occured on 1.13.0+dev-62-g8443ca109 on my LXD development container. ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** --> ![gitea-bug](https://user-images.githubusercontent.com/40219486/83965353-4c537c80-a8dd-11ea-9ca7-30225d7c657a.gif)
GiteaMirror added the issue/stale label 2025-11-02 06:27:02 -06:00
Author
Owner

@hmht commented on GitHub (Jun 10, 2020):

I have the same in 1.11.6. I've logged out frequently in 1.10.3

@hmht commented on GitHub (Jun 10, 2020): I have the same in 1.11.6. I've logged out frequently in 1.10.3
Author
Owner

@zeripath commented on GitHub (Jun 11, 2020):

@bagasme I think there's possibly an issue with caching here.

Certainly jquery.are-you-sure is listed as a dependency in the index.js and the package.json.

Is there any way you could actually check if the areYouSure function is defined in the index.js that is served? e.g.

curl URL/js/index.js | grep -o 'areYouSure=function'

e.g. for try this is:

$ curl https://try.gitea.io/js/index.js | grep -o 'areYouSure=function'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  549k  100  549k    0     0   620k      0 --:--:-- --:--:-- --:--:--  619k
areYouSure=function

showing that it is defined and therefore the problem is caching.

@zeripath commented on GitHub (Jun 11, 2020): @bagasme I think there's possibly an issue with caching here. Certainly jquery.are-you-sure is listed as a dependency in the index.js and the package.json. Is there any way you could actually check if the areYouSure function is defined in the index.js that is served? e.g. ```bash curl URL/js/index.js | grep -o 'areYouSure=function' ``` e.g. for try this is: ```bash $ curl https://try.gitea.io/js/index.js | grep -o 'areYouSure=function' % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 549k 100 549k 0 0 620k 0 --:--:-- --:--:-- --:--:-- 619k areYouSure=function ``` showing that it is defined and therefore the problem is caching.
Author
Owner

@hmht commented on GitHub (Jun 12, 2020):

in my installation the following command returns nothing:

curl http://gitea.example.com/js/index.js | grep -o 'areYouSure=function'

my upgrade process is basically just "replace the gitea binary", and last time I went from 10.3 to 11.6. Maybe that's the problem.

@hmht commented on GitHub (Jun 12, 2020): in my installation the following command returns nothing: ``` curl http://gitea.example.com/js/index.js | grep -o 'areYouSure=function' ``` my upgrade process is basically just "replace the gitea binary", and last time I went from 10.3 to 11.6. Maybe that's the problem.
Author
Owner

@zeripath commented on GitHub (Jun 12, 2020):

@hmht No that shouldn't be a problem.

@zeripath commented on GitHub (Jun 12, 2020): @hmht No that shouldn't be a problem.
Author
Owner

@zeripath commented on GitHub (Jun 12, 2020):

@hmht 1.11 doesn't web pack the are you sure function so that grep wouldn't work for you. I still think this is very likely to be a caching issue.

@zeripath commented on GitHub (Jun 12, 2020): @hmht 1.11 doesn't web pack the are you sure function so that grep wouldn't work for you. I still think this is very likely to be a caching issue.
Author
Owner

@hmht commented on GitHub (Jun 16, 2020):

Turns out the problem is that you need javascript enabled to log out.

@hmht commented on GitHub (Jun 16, 2020): Turns out the problem is that you need javascript enabled to log out.
Author
Owner

@bagasme commented on GitHub (Jun 17, 2020):

@hmht js is enabled by default on most browsers, unfortunately. Also, I had tested on both normal and private windows on my browser, and the problem still exists.

@bagasme commented on GitHub (Jun 17, 2020): @hmht js is enabled by default on most browsers, unfortunately. Also, I had tested on both normal and private windows on my browser, and the problem still exists.
Author
Owner

@zeripath commented on GitHub (Jun 17, 2020):

@bagasme did you try the curl I mentioned?

@zeripath commented on GitHub (Jun 17, 2020): @bagasme did you try the curl I mentioned?
Author
Owner

@bagasme commented on GitHub (Jun 18, 2020):

@zeripath nothing happened, returns nothing (no matches). I accessed my instance with HTTPS address (https://myinstance for example)

@bagasme commented on GitHub (Jun 18, 2020): @zeripath nothing happened, returns nothing (no matches). I accessed my instance with HTTPS address (`https://myinstance` for example)
Author
Owner

@stale[bot] commented on GitHub (Aug 24, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (Aug 24, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@stale[bot] commented on GitHub (Sep 7, 2020):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (Sep 7, 2020): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5508