Thanks again for the great support!
I created fresh wordpress and Nextcloud sites (latest versions).
I installed version 1.9 of your plugin.
I created a (Sydney) Child Theme, changed to it, and used the Code Snippets plugin to insert your code into that theme’s functions.php file.
I use the url from your button (https://site.xxxx.net/wp-login.php?nc-sso=redirect) both in my login menu item and to replace my Download button with a ‘Please login to download’ link when a member is not logged in.
I have left the ‘On login redirect user to’ in your Settings empty.
While logged off, I went to the page with the download on it and clicked on my ‘Please login to download’ link.
It logged in, but went to the main page not the Download page. I also went to another page (while logged off) and clicked on my ‘Log in’ in the menu bar and it also went back to the main page.
I tried this with the ‘Temp Key Storage Type’ set to both ‘Session’ and ‘Cookie’.
I also disabled the ‘Code Snippets’ and inserted your php code directly into the Child’s functions.php file. The results were the same.
When I enter a url into the ‘On login redirect user to’ field it uses that as its redirect and goes to that page.
Any suggestions or am I doing something wrong?
I can send the log file or give you access to the sites if you wish.
[Using with Firefox 100.0.2 (64 bit) and Safari 15.1 on macOS 12.0.1]