chore: Clarify use of window fields in UIWindowEmailConfirmationRequired

/puter/src/UI/UIWindowEmailConfirmationRequired.js
  113:26  error  'api_origin' is not defined         no-undef
  121:52  error  'auth_token' is not defined         no-undef
  125:29  error  'logout' is not defined             no-undef
  131:29  error  'refresh_user_data' is not defined  no-undef
  160:22  error  'api_origin' is not defined         no-undef
  165:48  error  'auth_token' is not defined         no-undef
  169:25  error  'logout' is not defined             no-undef
  188:13  error  'logout' is not defined             no-undef
This commit is contained in:
Sam Atkins 2024-05-01 16:34:22 +01:00
parent 2f6fcdb878
commit dea3bc1a7f

View File

@ -110,7 +110,7 @@ function UIWindowEmailConfirmationRequired(options){
setTimeout(() => {
$.ajax({
url: api_origin + "/confirm-email",
url: window.api_origin + "/confirm-email",
type: 'POST',
data: JSON.stringify({
code: final_code,
@ -118,17 +118,17 @@ function UIWindowEmailConfirmationRequired(options){
async: true,
contentType: "application/json",
headers: {
"Authorization": "Bearer "+auth_token
"Authorization": "Bearer "+window.auth_token
},
statusCode: {
401: function () {
logout();
window.logout();
},
},
success: function (res){
if(res.email_confirmed){
$(el_window).close();
refresh_user_data(window.auth_token)
window.refresh_user_data(window.auth_token)
resolve(true);
}else{
$(el_window).find('.error').html('Invalid confirmation code.');
@ -157,16 +157,16 @@ function UIWindowEmailConfirmationRequired(options){
// send email confirmation
$(el_window).find('.send-conf-email').on('click', function(e){
$.ajax({
url: api_origin + "/send-confirm-email",
url: window.api_origin + "/send-confirm-email",
type: 'POST',
async: true,
contentType: "application/json",
headers: {
"Authorization": "Bearer "+auth_token
"Authorization": "Bearer "+window.auth_token
},
statusCode: {
401: function () {
logout();
window.logout();
},
},
success: async function (res){
@ -185,7 +185,7 @@ function UIWindowEmailConfirmationRequired(options){
// logout
$(el_window).find('.conf-email-log-out').on('click', function(e){
logout();
window.logout();
$(el_window).close();
})