fix(tests): update OAuth tests to use correct signature URL path

Change test URLs from '/sign?doc=' to '/?doc=' to match the correct
frontend route after the URL path correction in reminder emails.

Updated base64 encoded state in callback test:
- Old: L3NpZ24_ZG9jPXRlc3Q (decodes to /sign?doc=test)
- New: Lz9kb2M9dGVzdA (decodes to /?doc=test)
This commit is contained in:
Benjamin
2025-11-06 01:14:43 +01:00
parent 7b1f69ade6
commit cff602c812
4 changed files with 9 additions and 9 deletions

View File

@@ -393,7 +393,7 @@ func TestOauthService_GetAuthURL(t *testing.T) {
},
{
name: "specific page next URL",
nextURL: "/sign?doc=test-doc",
nextURL: "/?doc=test-doc",
},
{
name: "empty next URL",
@@ -401,7 +401,7 @@ func TestOauthService_GetAuthURL(t *testing.T) {
},
{
name: "complex next URL with parameters",
nextURL: "/sign?doc=test-doc&referrer=github",
nextURL: "/?doc=test-doc&referrer=github",
},
}
@@ -757,8 +757,8 @@ func TestOauthService_HandleCallback_StateDecoding(t *testing.T) {
}{
{
name: "valid state with next URL",
state: "randomstate:L3NpZ24_ZG9jPXRlc3Q", // base64 for "/sign?doc=test"
expectedURL: "/sign?doc=test",
state: "randomstate:Lz9kb2M9dGVzdA", // base64 for "/?doc=test"
expectedURL: "/?doc=test",
},
{
name: "state without separator",

View File

@@ -170,7 +170,7 @@ func TestSendSignatureReminderEmail(t *testing.T) {
locale: "es",
docID: "doc789",
docURL: "https://example.com/doc.pdf",
signURL: "https://example.com/sign?doc=doc789",
signURL: "https://example.com/?doc=doc789",
recipientName: "Juan Garcia",
expectedSubject: "Reminder: Document reading confirmation required",
sendError: nil,
@@ -182,7 +182,7 @@ func TestSendSignatureReminderEmail(t *testing.T) {
locale: "en",
docID: "doc999",
docURL: "https://example.com/doc.pdf",
signURL: "https://example.com/sign?doc=doc999",
signURL: "https://example.com/?doc=doc999",
recipientName: "Test User",
expectedSubject: "Reminder: Document reading confirmation required",
sendError: errors.New("email server unavailable"),
@@ -194,7 +194,7 @@ func TestSendSignatureReminderEmail(t *testing.T) {
locale: "en",
docID: "doc000",
docURL: "https://example.com/doc.pdf",
signURL: "https://example.com/sign?doc=doc000",
signURL: "https://example.com/?doc=doc000",
recipientName: "",
expectedSubject: "Reminder: Document reading confirmation required",
sendError: nil,

View File

@@ -52,7 +52,7 @@ function onOpen() {
* Redirige vers la page de validation Ackify
*/
function validateReading() {
const signUrl = `${ACKIFY_BASE_URL}/sign?doc=${DOCUMENT_ID}&referrer=${encodeURIComponent(getDocumentUrl())}`;
const signUrl = `${ACKIFY_BASE_URL}/?doc=${DOCUMENT_ID}&referrer=${encodeURIComponent(getDocumentUrl())}`;
const html = `
<div style="padding: 20px; font-family: Arial, sans-serif;">

View File

@@ -19,7 +19,7 @@ function getSidebarHtml() {
function openSignature() {
var doc = DocumentApp.getActiveDocument();
var docId = doc.getId();
var url = "https://sign.neodtx.com/sign?doc=" + encodeURIComponent(docId);
var url = "https://sign.kolapsis.com/?doc=" + encodeURIComponent(docId);
var html = '<style>html,body{height:100%;margin:0;padding:0}</style>' +
'<iframe src="' + url + '" ' +