Fix test, add env-variables
This commit is contained in:
parent
85f730644f
commit
08e259ebf6
|
|
@ -48,7 +48,7 @@ describe('The Login Page', () => {
|
|||
|
||||
cy.get('[data-cy=logout]').click();
|
||||
|
||||
cy.get('[data-cy=email-input]').should('exist').within(() => {
|
||||
cy.get('[data-cy=oauth-login]').should('exist').within(() => {
|
||||
cy.visit('/beta-login');
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -154,6 +154,7 @@ function joiningClass(to) {
|
|||
}
|
||||
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
console.log('to', from, to)
|
||||
if (to.path === '/logout') {
|
||||
publicApolloClient.resetStore();
|
||||
next({name: 'hello'});
|
||||
|
|
@ -162,7 +163,7 @@ router.beforeEach(async (to, from, next) => {
|
|||
|
||||
if (unauthorizedAccess(to)) {
|
||||
const postLoginRedirectionUrl = to.path;
|
||||
const redirectUrl = `/api/oauth/login/`;
|
||||
const redirectUrl = `/hello/`;
|
||||
|
||||
if (window.localStorage) {
|
||||
localStorage.setItem(postLoginRederictUrlKey, postLoginRedirectionUrl);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
<h1
|
||||
class="hello__title public-page__title"
|
||||
data-cy="hello-title">Wollen Sie {{ pageTitle }} jetzt im Unterricht verwenden?</h1>
|
||||
<a href="/api/oauth/login/">Login</a>
|
||||
<a href="/api/oauth/login/"
|
||||
data-cy="oauth-login">Login</a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -27,41 +28,6 @@
|
|||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
validateBeforeSubmit() {
|
||||
this.$validator.validate().then(result => {
|
||||
this.submitted = true;
|
||||
if (result) {
|
||||
this.loading = true;
|
||||
// emailExists(this.email).then((response) => {
|
||||
// let redirectRouteName = 'login';
|
||||
//
|
||||
// if (response.data) {
|
||||
// redirectRouteName = 'registration';
|
||||
// }
|
||||
// this.$apollo.mutate({
|
||||
// mutation: HELLO_EMAIL_MUTATION,
|
||||
// variables: {
|
||||
// helloEmail: this.email
|
||||
// }
|
||||
// }).then(() => {
|
||||
// this.$router.push({name: redirectRouteName, query: this.$route.query});
|
||||
// this.loading = false;
|
||||
// });
|
||||
// })
|
||||
// .catch(() => {
|
||||
// this.loading = false;
|
||||
// this.registrationError = 'Es ist ein Fehler aufgetreten. Bitte versuchen Sie es nochmals.';
|
||||
// });
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm() {
|
||||
this.email = '';
|
||||
this.submitted = false;
|
||||
this.$validator.reset();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@ export EMAIL_HOST_PASSWORD=
|
|||
export EMAIL_HOST_USER=
|
||||
export EMAIL_PORT=
|
||||
export GOOGLE_ANALYTICS_ID=
|
||||
export HEP_ADMIN_PASSWORD=
|
||||
export HEP_ADMIN_USER=
|
||||
export HEP_URL=
|
||||
export HEP_URL=https://stage.hep-verlag.ch
|
||||
export MATOMO_HOST=
|
||||
|
|
@ -33,3 +31,9 @@ export PG_BACKUP_KEY=
|
|||
export BACKUP_AWS_ACCESS_KEY_ID=
|
||||
export BACKUP_AWS_SECRET_ACCESS_KEY=
|
||||
export BACKUP_S3_BUCKET_NAME=
|
||||
export OAUTH_CLIENT_ID=
|
||||
export OAUTH_CLIENT_SECRET=
|
||||
export OAUTH_ACCESS_TOKEN_URL=
|
||||
export OAUTH_AUTHORIZE_URL=
|
||||
export OAUTH_API_BASE_URL=
|
||||
export OAUTH_LOCAL_REDIRECT_URI=
|
||||
|
|
|
|||
|
|
@ -397,8 +397,6 @@ EMAIL_USE_SSL = False
|
|||
ALLOW_BETA_LOGIN = True
|
||||
|
||||
# HEP
|
||||
HEP_ADMIN_USER = os.environ.get("HEP_ADMIN_USER")
|
||||
HEP_ADMIN_PASSWORD = os.environ.get("HEP_ADMIN_PASSWORD")
|
||||
HEP_URL = os.environ.get("HEP_URL")
|
||||
|
||||
# HEP Oauth
|
||||
|
|
|
|||
|
|
@ -9,4 +9,10 @@ export DATABASE_URL=postgres://$DATABASE_USER:$PGPASSWORD@$DATABASE_HOST:$DATABA
|
|||
export DEBUG=True
|
||||
export USE_AWS=False
|
||||
export SERVE_VIA_WEBPACK=False
|
||||
export OAUTH_CLIENT_ID=1111111-222222-333-3444444
|
||||
export OAUTH_CLIENT_SECRET=Abcd1234!
|
||||
export OAUTH_ACCESS_TOKEN_URL=https://hepverlag-cms.grape.novu.ch/oauth/token
|
||||
export OAUTH_AUTHORIZE_URL=https://hepverlag-cms.grape.novu.ch/oauth/authorize
|
||||
export OAUTH_API_BASE_URL=https://hepverlag-cms.grape.novu.ch/
|
||||
export OAUTH_LOCAL_REDIRECT_URI=http://localhost:8000/api/oauth/callback/
|
||||
pipenv install --dev --system
|
||||
|
|
|
|||
Loading…
Reference in New Issue