mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-03 07:48:46 +08:00
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:
parent
2f6fcdb878
commit
dea3bc1a7f
@ -110,7 +110,7 @@ function UIWindowEmailConfirmationRequired(options){
|
|||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: api_origin + "/confirm-email",
|
url: window.api_origin + "/confirm-email",
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
code: final_code,
|
code: final_code,
|
||||||
@ -118,17 +118,17 @@ function UIWindowEmailConfirmationRequired(options){
|
|||||||
async: true,
|
async: true,
|
||||||
contentType: "application/json",
|
contentType: "application/json",
|
||||||
headers: {
|
headers: {
|
||||||
"Authorization": "Bearer "+auth_token
|
"Authorization": "Bearer "+window.auth_token
|
||||||
},
|
},
|
||||||
statusCode: {
|
statusCode: {
|
||||||
401: function () {
|
401: function () {
|
||||||
logout();
|
window.logout();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
success: function (res){
|
success: function (res){
|
||||||
if(res.email_confirmed){
|
if(res.email_confirmed){
|
||||||
$(el_window).close();
|
$(el_window).close();
|
||||||
refresh_user_data(window.auth_token)
|
window.refresh_user_data(window.auth_token)
|
||||||
resolve(true);
|
resolve(true);
|
||||||
}else{
|
}else{
|
||||||
$(el_window).find('.error').html('Invalid confirmation code.');
|
$(el_window).find('.error').html('Invalid confirmation code.');
|
||||||
@ -157,16 +157,16 @@ function UIWindowEmailConfirmationRequired(options){
|
|||||||
// send email confirmation
|
// send email confirmation
|
||||||
$(el_window).find('.send-conf-email').on('click', function(e){
|
$(el_window).find('.send-conf-email').on('click', function(e){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: api_origin + "/send-confirm-email",
|
url: window.api_origin + "/send-confirm-email",
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
async: true,
|
async: true,
|
||||||
contentType: "application/json",
|
contentType: "application/json",
|
||||||
headers: {
|
headers: {
|
||||||
"Authorization": "Bearer "+auth_token
|
"Authorization": "Bearer "+window.auth_token
|
||||||
},
|
},
|
||||||
statusCode: {
|
statusCode: {
|
||||||
401: function () {
|
401: function () {
|
||||||
logout();
|
window.logout();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
success: async function (res){
|
success: async function (res){
|
||||||
@ -185,7 +185,7 @@ function UIWindowEmailConfirmationRequired(options){
|
|||||||
|
|
||||||
// logout
|
// logout
|
||||||
$(el_window).find('.conf-email-log-out').on('click', function(e){
|
$(el_window).find('.conf-email-log-out').on('click', function(e){
|
||||||
logout();
|
window.logout();
|
||||||
$(el_window).close();
|
$(el_window).close();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user