csivitu / accounts Goto Github PK
View Code? Open in Web Editor NEWCSI's own OpenID Connect provider, to login into CSI websites.
License: MIT License
CSI's own OpenID Connect provider, to login into CSI websites.
License: MIT License
accounts/config/dbconfig/dbInit.go
Line 26 in af63471
In a couple of places like this, I see that you've used global variables and the init()
function to assign values to the variables, but in general, using a global variable makes the code less maintainable. In golang
we always prefer to use structs instead of global variables. Then, the functions can become attributes of that struct. For example,
accounts/controllers/userController.go
Lines 15 to 19 in af63471
Instead of doing this, you could just create a db
object inside the Signup
function.
Another thing I noticed is that you have some structs inside function, which are reusable, like
type response struct {
Status string `json:"status"`
Message string `json:"message"`
User models.User `json:"user"`
}
I would prefer to export the common structs from a package maybe? Or maybe they could be in the controllers package itself, in a separate file, then you wouldn't have to export them either.
Lastly, I hope the names of the routes are in accordance with the OpenID specification so that we can use general libraries to connect with CSI accounts.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.