fix #216. Add base5

encode. Also add cypress.
This commit is contained in:
Cindy Chang
2024-06-11 12:23:17 +08:00
parent aa1dbfabf2
commit 314670eafd
2 changed files with 18 additions and 3 deletions

View File

@@ -0,0 +1,17 @@
const urlUnderTest = `https://REDACTED-HOST/login?return-to=aHR0cHM6Ly9sdWNpYS1kZXYuZHNwLmltL2Rpc2NvdmVyL2NvbmZvcm1hbmNlL2xvZy8xODU1MjQ3OTcvY29uZm9ybWFuY2U=`;
describe('Conformance', ()=>{
beforeEach(() => {
cy.visit(urlUnderTest);
});
it('After pasting discover/conformance/log/ page, frontend should redirect to corresponding\
page, not login page', () => {
cy.get('#account').clear().type(` ${Cypress.env('user').username} `);
cy.get('#password').clear().type(` ${Cypress.env('user').password} `);
cy.get('.btn-lg').click();
cy.get('form').submit();
cy.contains('Conformance Checking Results').should('be.visible');
})
});

View File

@@ -46,10 +46,8 @@ export default defineStore('loginStore', {
// 然而有一種情況是使用者在沒有登入的情況下貼上了某一個頁面的網址,
// 則在此情況下時,我們會在使用者稍後登入後,把使用者帶到剛才記住的 return-to 網址
if(this.rememberedReturnToUrl !== "") {
console.log('1111', );
window.location.href = this.rememberedReturnToUrl;
window.location.href = atob(this.rememberedReturnToUrl);
} else {
console.log('2222', );
this.$router.push('/login');
}
} catch(error) {