Update states, add verify email page

This commit is contained in:
Christian Cueni 2021-06-07 13:53:51 +02:00
parent 55502d5507
commit 5188d2a061
5 changed files with 27 additions and 26 deletions

View File

@ -1,19 +0,0 @@
<template>
<div class="check-email">
<main
class="check-email__content content"
data-cy="email-check">
<p class="content__instructions">Eine E-Mail ist auf dem Weg, bitte überprüfen Sie Ihr Postfach.</p>
</main>
</div>
</template>
<style scoped lang="scss">
@import "@/styles/_variables.scss";
.content__instructions {
margin-top: $medium-spacing;
}
</style>

View File

@ -0,0 +1,20 @@
<template>
<div class="verify-email">
<main
class="verify-email__content content"
data-cy="verify-check">
<p class="content__instructions">Ihre Email ist noch nicht verifiziert. Bitte verifizieren Sie die Email für
ihr hep-Konto.</p>
</main>
</div>
</template>
<style scoped lang="scss">
@import "@/styles/_variables.scss";
.content__instructions {
margin-top: $medium-spacing;
}
</style>

View File

@ -9,7 +9,7 @@ import submission from '@/pages/studentSubmission';
import Router from 'vue-router';
import surveyPage from '@/pages/survey';
import styleGuidePage from '@/pages/styleguide';
import checkEmail from '@/pages/check-email';
import verifyEmail from '@/pages/verify-email';
import licenseActivation from '@/pages/license-activation';
import joinClass from '@/pages/joinClass';
import news from '@/pages/news';
@ -56,9 +56,9 @@ const routes = [
meta: {layout: LAYOUT_SIMPLE},
},
{
path: '/check-email',
component: checkEmail,
name: 'checkEmail',
path: '/verify-email',
component: verifyEmail,
name: 'verifyEmail',
meta: {
public: true,
layout: 'public',
@ -85,7 +85,7 @@ const routes = [
case 'email_not_verified':
return '/verify-email';
case 'no_valid_license':
return '/verify-email';
return '/license-activation';
case 'success':
if (window.localStorage && localStorage.getItem(postLoginRederictUrlKey)) {
const redirectUrl = localStorage.getItem(postLoginRederictUrlKey);

View File

@ -182,7 +182,7 @@ class HepClient:
def filter_valid_products(product):
if product['status'] != 'paid':
if product['status'] not in ['paid', 'new']:
return False
expiry_delta = product['activated'] + timedelta(product['license']['duration'])

View File

@ -23,7 +23,7 @@ def authorize(request):
user, status_msg = handle_user_and_verify_products(user_data, token)
user.sync_with_hep_data(user_data)
except OAuthError:
except OAuthError as e:
return redirect(f'/login-success?state={UNKNOWN_ERROR}')
if user and status_msg != EMAIL_NOT_VERIFIED: