Determine if current session is the first time a user has logged in?

Hi,

I’m interested in knowing if there’s a way to determine if a session is the first time a user has logged in. I’d like to direct people to a specific ondemand app/page if it’s the first time they’ve logged in. Is this possible? Or can I put a banner on the home page only for first time users?

Not out of the box - but I think it’d be a nice feature to have! I made this ticket for the same.

I could imagine you writing an initializer and setting the MOTD_PATH or similar based on something - 0 files in their ~/ondemand/data directory? But that’s just an off the top hack that may work, but I think the scheme would still apply - determine if it’s an initial load in an initializer and reset/set some configs based off of that.

Thanks Jeff!

Where are the initializers? Is there any documentation about how those work? I’d like to get a chance to look into this to see if I can come up with something that might help.

Adding favorite paths works through an initializer. You can also search this discourse for other things (like creating custom queues and so on) with the initializer search string.

https://osc.github.io/ood-documentation/latest/customizations.html?highlight=initializer#add-shortcuts-to-files-menu

Rails gives us this facility to basically add/modify any functionality while the application starts up.

So you write any valid Ruby that could say change say the MOTD_PATH environment variable in-situ while it’s booting up before the MOTD is actually read.

if something
  ENV['MOTD_PATH'] = '/etc/some/folder/first_login_motd'
end
1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.