Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get token in register handler? #291

Open
ce2cs opened this issue May 19, 2022 · 2 comments
Open

How to get token in register handler? #291

ce2cs opened this issue May 19, 2022 · 2 comments

Comments

@ce2cs
Copy link

ce2cs commented May 19, 2022

New to web development. I was wondering how to get token if I need respond token in register API. I do not use the middleware in register router we cannot get a token before we register an account.

@storytellerGIT
Copy link

you may have a look at func (mw *GinJWTMiddleware) TokenGenerator(data interface{}) (string, time.Time, error)

@Starballoon
Copy link
Contributor

I guess that you have joined the training camp organized by ByteDance also. The framework gin has designed a chain call API, which means you can call the LoginHandler of this project after calling register function that has already registered the user somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants