[Glitch] Add polling and automatic redirection to `/start` on email confirmation
Port e60414792d
to glitch-soc
This commit is contained in:
parent
f959f6cdbb
commit
ba73f0ea3a
|
@ -45,6 +45,6 @@ class Auth::SetupController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_pack
|
def set_pack
|
||||||
use_pack 'auth'
|
use_pack 'sign_up'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,4 +16,5 @@ pack:
|
||||||
modal: public.js
|
modal: public.js
|
||||||
public: public.js
|
public: public.js
|
||||||
settings: settings.js
|
settings: settings.js
|
||||||
|
sign_up:
|
||||||
share:
|
share:
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
import 'packs/public-path';
|
||||||
|
import ready from 'flavours/glitch/ready';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
ready(() => {
|
||||||
|
setInterval(() => {
|
||||||
|
axios.get('/api/v1/emails/check_confirmation').then((response) => {
|
||||||
|
if (response.data) {
|
||||||
|
window.location = '/start';
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
|
}, 5000);
|
||||||
|
});
|
|
@ -20,6 +20,7 @@ pack:
|
||||||
modal:
|
modal:
|
||||||
public: packs/public.jsx
|
public: packs/public.jsx
|
||||||
settings: packs/settings.js
|
settings: packs/settings.js
|
||||||
|
sign_up: packs/sign_up.js
|
||||||
share: packs/share.jsx
|
share: packs/share.jsx
|
||||||
|
|
||||||
# (OPTIONAL) The directory which contains localization files for
|
# (OPTIONAL) The directory which contains localization files for
|
||||||
|
|
|
@ -20,6 +20,7 @@ pack:
|
||||||
modal:
|
modal:
|
||||||
public: public.jsx
|
public: public.jsx
|
||||||
settings: public.jsx
|
settings: public.jsx
|
||||||
|
sign_up: sign_up.js
|
||||||
share: share.jsx
|
share: share.jsx
|
||||||
|
|
||||||
# (OPTIONAL) The directory which contains localization files for
|
# (OPTIONAL) The directory which contains localization files for
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
- content_for :page_title do
|
- content_for :page_title do
|
||||||
= t('auth.setup.title')
|
= t('auth.setup.title')
|
||||||
|
|
||||||
= javascript_pack_tag 'sign_up', crossorigin: 'anonymous'
|
|
||||||
|
|
||||||
= simple_form_for(@user, url: auth_setup_path) do |f|
|
= simple_form_for(@user, url: auth_setup_path) do |f|
|
||||||
= render 'auth/shared/progress', stage: 'confirm'
|
= render 'auth/shared/progress', stage: 'confirm'
|
||||||
|
|
||||||
|
|
Reference in New Issue