Is it possible using the Javascript API to detect if a user is logged in and if not, prompt them to log in?
Javascript API - Loggin in a user
Anthony_Barnes
(Anthony Barnes)
#2
You could do something like:
getKeywordsReplacements(1234,["%globals_user_assetid%"],function(keyword){ // Check the keyword value here });
I can't remember off the top of my head if it returns the public user id if you aren't logged in, but in any case you will be able to determine if they are logged in or not.
Prompting them to login is different because the server generates a login key that must match to the credentials being submitted. The easiest way to achieve this would be to use the Matrix login design area and hide it in your page somewhere, then use javascript to reveal it after the keyword check has been made.
(Another way to achieve this would be to perhaps redirect them to the current page url with an '_login' suffix)
martinbutt
(Martin)
#3
[quote]
You could do something like:
getKeywordsReplacements(1234,["%globals_user_assetid%"],function(keyword){ // Check the keyword value here });
I can't remember off the top of my head if it returns the public user id if you aren't logged in, but in any case you will be able to determine if they are logged in or not.
Prompting them to login is different because the server generates a login key that must match to the credentials being submitted. The easiest way to achieve this would be to use the Matrix login design area and hide it in your page somewhere, then use javascript to reveal it after the keyword check has been made.
(Another way to achieve this would be to perhaps redirect them to the current page url with an '_login' suffix)
[/quote]
Thanks!