Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
schleuder-web
schleuder-web
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 44
    • Issues 44
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • schleuder
  • schleuder-webschleuder-web
  • Issues
  • #120

Closed
Open
Created Feb 02, 2021 by o-@o-

Redirect to originally requested url after login does not work

When I navigate to a particular resource on a schleuder-web interface with no pre-existing session, then I am not properly redirected to that url after login.

Steps to reproduce

  1. open an incognito window
  2. visit some-schleuder-web/lists/some_list
  3. login
  4. it wrongly redirects to / instead of /lists/some_list
  5. logout
  6. visit some-schleuder-web/lists/some_list again
  7. login
  8. it correctly redirects to /lists/some_list

Potential Fix

I am pretty sure the error is at https://0xacab.org/schleuder/schleuder-web/-/blob/master/app/controllers/application_controller.rb#L87 as I get the following error in the logs: Error: no implicit conversion of nil into String.

I would suggest a fix along these lines:

   def authenticate
-    expiry = Time.parse(session[:login_expires_at])
-    if current_account && expiry > Time.now
+    expiry = Time.parse("#{session[:login_expires_at]}") rescue nil
+    if current_account && expiry && expiry > Time.now
       update_session_expiry

However, what seems to be an additional issue is that the message at https://0xacab.org/schleuder/schleuder-web/-/blob/master/app/controllers/application_controller.rb#L110 is never displayed in the login form. The login form always says "please log in with your schleuder account" and does not display the error.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking