Comments (10)
Definitely sounds like a great idea! I could modify my code for this
from papercups.
Hi,
I want to send a PR on this.
Isn't this better that we add a boolean flag for user invite and keep the record that will invalidate the invitation link and save the record in the database for future use like analytics or showing past invitations?
from papercups.
hmm yeah @n1arash, good point -- maybe we can add a flag like you suggested or just update the expires_at
field to the current time, and then make sure we check against expiration before allowing the invitation to be used? what do you think?
from papercups.
I think updating the expires_at
field can do the job, and also we can send an appropriate error to the frontend if a user used the link again with a 403 status header.
from papercups.
sounds perfect @n1arash
from papercups.
Hi,
I've done some sample modifications that delete the invite token after user creation is successful. I also split out the logic for cases when an invite token is included in the params and when it isn't. I think logic for #59 can be added to the create method for invite tokens. It could be modified to set the boolean flag to the invites as @n1arash mentioned.
Please have a look at the commit on my repo fork.
from papercups.
@rlanga nice! your commit definitely looks like it solves the original issue, and i love the refactoring + test coverage 😁
i think what @n1arash mentioned might be a good idea though — instead of deleting the invite after it's used, it would be helpful to keep it around so we can have a record of which invites have been used vs not. so rather than deleting, we could set up a method like
ChatApi.UserInvitations.mark_user_invitation_expired(invite)
or something like that, and then throw a helpful error if someone tries to sign up with an expired invite. what do you think?
from papercups.
thanks @rlanga!
from papercups.
btw @rlanga and @n1arash if you ever want to chat with us directly about this, feel free to join our slack or discord channels https://github.com/papercups-io/papercups#get-in-touch 😄
from papercups.
handled in #81
from papercups.
Related Issues (20)
- Dev question HOT 1
- SMTP adapter is broken in Docker image
- Pull Request Preview Environments for increasing maintainer productivity
- Integrate pull request preview environments
- Deploy to Heroku button HOT 2
- Heroku one click deploy failed
- Upload fails from chat widget. HOT 7
- Ability to close live chat sessions from Mattermost
- BUG : In chat window the sending button dose not have an outline.
- Is this repo still maintained?
- Introducing new one-click deployment option (Elestio)
- Disable file upload
- It's possible to change the referrer meta field manually?
- Mark as unread HOT 1
- Reply from Slack integration doesn't forward incoming message to the Slack channel HOT 2
- Slack Interactivity Request URL for buttons to work
- Customer API endpoint doesn't update metadata HOT 11
- More Detailed Instructions for Deploying to AWS
- webhook via ngrok not challenged - local setup
- Incomplete docs, missing a few keys to getting storytime to work. (listed them here)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from papercups.