Code Monkey home page Code Monkey logo

Comments (6)

cuducos avatar cuducos commented on May 25, 2024 1

Just thinking out loud: maybe the same message argument could be used to turn the feature on/off.

  1. SimpleLogin(app), implying messages = None, uses the defaults, which if show messages as defined in the package
  2. SimpleLogin(app, messages=messages) uses the customized messages passed
  3. SimpleLogin(app, messages=False) turns off the messaging feature
messages value/type On/Off Message texts
None On Default
dict On Customized
False Off N/A

from flask-simplelogin.

jforseth210 avatar jforseth210 commented on May 25, 2024

I don't know, I'm still a beginner, but I'd love to hear your thoughts on this, and to contribute where I can.

from flask-simplelogin.

cuducos avatar cuducos commented on May 25, 2024

I do think it's a great idea and I'm willing to support anyone in developing this.

I have two minor comments, though:

  1. I think that aligned with every other simple (one value) customization we have, I would encourage a setting SIMPLELOGIN_SHOW_MESSAGE instead of using an argument in the SimpleLogin(show_messages=False).
  2. Regarding the messages, I'd go for a namedtuple instead of a dictionary, that is to say
messages = {
    'login-success': Message('someCategory', 'someMessage')
}

instead of:

messages = {
    'login-success', {'message':'someMessage', 'category':'someCategory'},
}

from flask-simplelogin.

jforseth210 avatar jforseth210 commented on May 25, 2024

I like that idea. That's a lot clearer and simpler way of doing it. My only concern is with access_denied and auth_error. I didn't realize those were return statements, I assumed the were all flash()

I guess it would make the most sense just the leave them as is, but it seems inconsistent, and harder to explain that way.

Once I've written some code, how do I share it with you? Is that what a pull request is for? Or is that only when everything is finished? Obviously I can't commit to a new branch, right?

from flask-simplelogin.

cuducos avatar cuducos commented on May 25, 2024

Once I've written some code, how do I share it with you? Is that what a pull request is for?

Yes, that is what pull requests are for 🤘

Or is that only when everything is finished?

You can open a PR (pull request) as a draft (or work in progress), that is great for a more interactive cycle of feedback and development.

Obviously I can't commit to a new branch, right?

Actually that's the best strategy to create a pull request! I'll try to summarize the steps:

  1. Fork this repository in your account
  2. Clone your fork locally
  3. Create a new branch for you to work on this features
  4. Get started, yay
  5. Commit progress to this new branch
  6. Push changes to your remote repository (still in the feature branch)
  7. At this point you can go back to GitHub page and open the PR
  8. Also, once you open the PR, every commit pushed to that featured branch will be automatically included in the opened PR

from flask-simplelogin.

cuducos avatar cuducos commented on May 25, 2024

Closed by #18

from flask-simplelogin.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.