Commit a5261656 authored by Julien Schröter's avatar Julien Schröter Committed by Julien Schröter

Prepare JWT and email verification link to release

parent 24d61265
Pipeline #1461 passed with stage
in 4 minutes and 44 seconds
......@@ -12,7 +12,7 @@
account, go ahead and click the following link:
</p>
<p>
<a href="https://dev.akamu.de/api/verify?token={{.Token}}">https://dev.akamu.de/api/verify?token={{.Token}}</a>
<a href="https://akamu.de/api/v2/verify?token={{.Token}}">https://akamu.de/api/v2/verify?token={{.Token}}</a>
</p>
<p>Note that the link is only valid for 24 hours.</p>
......
......@@ -117,7 +117,7 @@ func getRoot(ctx *gin.Context) {
}
func SetupRoutes(courseRepository course.CourseQuery, flashcardRepository flashcard.FlashcardQuery, subjectRepository subject.SubjectQuery, titleRepository title.TitleQuery, traininglistRepository traininglist.TrainingListQuery, userRepository user.UserQuery, poolRepository pool.PoolQuery, friendRepository friend.FriendQuery, avatarRepository avatar.AvatarQuery, duelRepository duel.DuelQuery, refreshjwtRepository refreshjwt.RefreshJWTQuery, resourceServerConfig *config.ResourceServer, settings *setting.Settings, smtpTransport *sendmail.Transport, jwtSecret ...string) *gin.Engine {
//gin.SetMode(gin.ReleaseMode)
gin.SetMode(gin.ReleaseMode)
router := gin.Default()
router.GET("/", getRoot)
......@@ -133,9 +133,8 @@ func SetupRoutes(courseRepository course.CourseQuery, flashcardRepository flashc
// The jwt can be refreshed until 2 years after the last signin. After this duration,
// the user has to log in again with his username and password.
MaxRefresh: time.Hour * 24 * 365 * 2,
// Token has to be refreshed every 15 minutes. Niklas requested a longer timeout for
// development. For release, change the timout back to 15 minutes!
Timeout: time.Minute * 60 * 24 * 30,
// Token has to be refreshed every 15 minutes.
Timeout: time.Minute * 15,
Authenticator: authenticate(userRepository, refreshjwtRepository),
Unauthorized: func(c *gin.Context, code int, message string, err error) {
switch err {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment