Skip to content

Commit

Permalink
Merge pull request #187 from poap-xyz/development
Browse files Browse the repository at this point in the history
Redirect to the poap mint and extend expiration auth token to mint
  • Loading branch information
SebaPucheta authored May 21, 2024
2 parents 9de2a10 + 8112897 commit d2a4d63
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
5 changes: 2 additions & 3 deletions cypress/e2e/user-claimer/2-stress-test-claim.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ context( 'Claimer can view valid events', () => {
cy.get( 'svg[data-code]' ).invoke( 'attr', 'data-code' ).as( 'public_auth_link' ).then( f => cy.log( `Event public auth link: ${ this.public_auth_link }` ) )

} )


/*
it( 'Successfully gets 3 challenge links', function( ) {
Expand Down Expand Up @@ -116,6 +115,6 @@ context( 'Claimer can view valid events', () => {
cy.contains( 'Deletion success!' )
cy.url().should( 'eq', Cypress.config().baseUrl + '/' )
} )
} ) */

} )
4 changes: 2 additions & 2 deletions cypress/e2e/user-claimer/2-view-and-claim-w-game.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ context( 'Claimer can view valid events with game', () => {
cy.get( 'svg[data-code]' ).invoke( 'attr', 'data-code' ).as( 'event_1_public_auth_link' ).then( f => cy.log( `Event 1 public auth link: ${ this.event_1_public_auth_link }` ) )

} )

/*
it( 'Event 1: Successfully redirects to challenge link and play game', function( ) {
// Store current
Expand Down Expand Up @@ -200,7 +200,7 @@ context( 'Claimer can view valid events with game', () => {
} )
} )
} ) */

// Delete event 1
it( 'Event 1: Deletes the event when clicked', function() {
Expand Down
2 changes: 1 addition & 1 deletion functions/modules/claim.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ app.get( '/claim/:event_id/:public_auth_token', async ( req, res ) => {
// Note: this sets how long scans are valid, it is an ESSENTIAL part of this applicaion
// CI is set low so we can check if our app is performans
// Live is set longer so that users on slow networks are not penalised
const old_auth_grace_period_in_ms = 1000 * ( CI || is_test_event ? 30 : 30 )
const old_auth_grace_period_in_ms = 1000 * ( CI || is_test_event ? 60 : 60 )

// Check whether the (previous) auth token is still valid
const current_auth_is_valid = public_auth?.token == public_auth_token
Expand Down
2 changes: 1 addition & 1 deletion public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"info": "This field will be injected as CSS overrides during the claiming process."
},
"dropBaseurl": {
"placeholder": "https://kiosk.poap.xyz/#/static/claim/",
"placeholder": "https://poap.xyz/claim/",
"label": "POAP Claim Baseurl Override",
"info": "Instead of redirecting to the POAP interface to claim a POAP, redirect it to any URL of your choosing."
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/EventAdmin.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export default function EventAdmin( ) {
if( loading ) return <Loading message={ loading } />

{ /* Event meta loaded, no codes available */ }
if( !event.loading && !event.codes ) return <Layout hide_background >
if( !event.loading && event.name && !event.codes ) return <Layout hide_background >
<Section align='flex-start' margin="0">

<Text>{ t( 'eventAdmin.hero.notavailable.title' ) }</Text>
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/claim_codes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useParams } from "react-router-dom"
import { dev, log } from "../modules/helpers"
import { log } from "../modules/helpers"
import { get_code_by_challenge, requestManualCodeRefresh, trackEvent } from "../modules/firebase"
import { useChallenge } from "./challenges"
import { useEffect, useState } from "react"
Expand Down Expand Up @@ -51,7 +51,7 @@ export const useClaimcodeForChallenge = ( captchaResponse, fetch_code=false ) =>

// Formulate redirect depending on claim type
log( `Generating claim link based on code ${ claim_code } and event data `, event )
let link = `${ dev ? `http://localhost:3000` : VITE_publicUrl }/#/mint/${ claim_code }/${ challenge_code }`
let link = `https://poap.xyz/claim/${ claim_code }`
if( event?.collect_emails ) link = `${ VITE_publicUrl }/#/static/claim/${ claim_code }`
if( event?.claim_base_url ) link = `${ event?.claim_base_url }${ claim_code }`

Expand Down

0 comments on commit d2a4d63

Please sign in to comment.