30 lines
1.5 KiB
Plaintext
30 lines
1.5 KiB
Plaintext
.row
|
|
h1 data-t='obtain_token.title' = t('user.obtain_token.title')
|
|
hr
|
|
/form
|
|
.form-row
|
|
.form-label
|
|
label.control-label data-t='attributes.user.email' = User.human_attribute_name(:email)
|
|
.form-field
|
|
input#user-email.email type="email" placeholder=User.human_attribute_name(:email)
|
|
.form-row
|
|
.form-label
|
|
label.control-label data-t='attributes.user.password' Password
|
|
.form-field
|
|
input#user-password.password type="password" placeholder="Password"
|
|
.form-row
|
|
.form-label
|
|
.form-field
|
|
button.btn.btn-primary data-t="obtain_token.obtain" onclick="Quser.authenticate_user(); return false" = t('user.obtain_token.obtain')
|
|
- unless current_user.blank? || ENV['QWAITER_MOBILE_EXPORT']=='yes'
|
|
javascript:
|
|
Qstorage = window.localStorage;
|
|
Qstorage.setItem('auth_token', '#{current_user.authentication_token}');
|
|
Qstorage.setItem('user_id', '#{current_user.id}');
|
|
window.location = (Qstorage.getItem('root_url') || '/index.html') + '?user_id=#{current_user.id}&auth_token=#{current_user.authentication_token}';
|
|
// localStorage.setItem('auth_token', '#{current_user.authentication_token}');
|
|
// localStorage.setItem('user_id', '#{current_user.id}');
|
|
// window.location = $root_url + '?user_id=#{current_user.id}&auth_token=#{current_user.authentication_token}';
|
|
// debugger;
|
|
// QMobile.signed_in({user_id: '#{current_user.id}', auth_token: '#{current_user.authentication_token}'});
|