From ddffb98cd53b2152f94ba70b8416b75bbfc286cd Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 27 Jun 2024 22:55:02 +0200 Subject: [PATCH] chore: Update cookie expiration time to use time.Until() instead of int(expirationTime.Unix()) --- occupi-backend/configs/config.yaml.gpg | Bin 268 -> 271 bytes occupi-backend/configs/dev.deployed.yaml.gpg | Bin 660 -> 697 bytes occupi-backend/configs/dev.localhost.yaml.gpg | Bin 0 -> 656 bytes occupi-backend/configs/prod.yaml.gpg | Bin 651 -> 689 bytes occupi-backend/configs/test.yaml.gpg | Bin 591 -> 630 bytes occupi-backend/pkg/handlers/auth_handlers.go | 2 +- 6 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 occupi-backend/configs/dev.localhost.yaml.gpg diff --git a/occupi-backend/configs/config.yaml.gpg b/occupi-backend/configs/config.yaml.gpg index dad021a41aa8deace2621374c96b8e868f050a4e..92257cc4ac2d43364cc4a3597d006f2ef6bde8e6 100644 GIT binary patch literal 271 zcmV+q0r38e4Fm}T0*XiB&B`yABmdICJppRA&(&Owxb2@li04lwpWPz6_QtFC9aIg$ zt-+vhhStejA&FdC0zy7x!BuOx|GBRR;`DWEq8|sOZ%~RUL7!%OH-fo(6vo3(T{rYD z2&p9^tQWCnra{ycXPE0=QbsLlL4_ICDqyqSJa4qGSFfJUJHM!$)i{`#@GGUHkoIx8 z5!AqJ-I2X!-WM56mX}w?_yIZLmt2YXx3C-6HV~N}+hkaucibTnY1};9?iw@A5dwdy z8O8z*R7sjlg5i|A=M>b7O>(b9z6Z==__hDa-{Lj+6Q6~2!lE<$2D46cHmWX6L&e8L Vf^oD{YcD8F$D;x0&_q?J2C~qng~I>< literal 268 zcmV+n0rUQh4Fm}T0?S@;6Rl-IKk?GQIsu76qnfY+7fSICrG zD5+Ri*tH|fHX@3)Z3b~dM6jyP_h~DrqeA{f+*tknzQt+~hRi}~x(!20310AC+PM4t zpzo;M*KeD@H?(C~4l&jucm>M9*FQ~7AXTW}fM5*c3J^QU5ID~Drx;5Novf~ZwQyACG5*D# zt3(b;YMh*XJbrJd9~}oA_wxYjS1tL|f35Pi7nsbpf2%ugTEu!vleEB|(#trdIG%m# S@x;>`pnsjWLP$Z77pGe<6NIY( diff --git a/occupi-backend/configs/dev.deployed.yaml.gpg b/occupi-backend/configs/dev.deployed.yaml.gpg index 0acf116f63ef69e149e842cd827b16257c374f0b..2e60679a75e5a158677172638a49add11835ced8 100644 GIT binary patch literal 697 zcmV;q0!ICe4Fm}T0`2tLEZI!>R{zrJ0Z?}7jkIQS?^C_Zc#Y~C3>}mg;Z7PA#$IEi zl6Wzk7w7TYxQIR0PTPuF%ezlCkKAo7TY&lh*mzn8q74ukdKr9;8%DoJbAbMSnPqlH z1?38x%Gb|stK@%9SIP(DR6#}e7062o75}(0>RATfL3c$o#s*SJLub;bo|#jJ+4!gN zm^6&aAoM=B%x51za;B+3K zo3XkBYfzypz~ULm$#x9P%Rrmc@=k*y1+un(M0|ThC>p1XJPjZ=`ZcqMETGfcTD$-= zT&w!V42QM)=d&&hKwT4#errZjoq;0*7o^jk*CyY)F(;dtkL*tI4gjh1 zDB--9$vh>egkeZ}U?0lZWMv=%EC<+;IG7Q)W`X9*tsrCSCAV0Fk89I1q3Z>tR%q-U ztzi?50_oEsWOVDhi6tZO?^*)dpe*PU6%e_H*cxyr(pydJ*O#Ampaa=t!&gZ+rQuesxdLc536*Z>u*ZJ+z5@R zNkrz^QpVnxi=uAD3;fgXRCRKbpjRf&lc~7)*t~6D{5JDqT*}B?*zy(gK5Rhq#XsGb zQBQEt+u-ZM-Arb^p7+P#vY13kIM8e3d$F^;$!$5L3G;6cVK8Q>LEGR?90yhB@nzwj fNdarbN-Xl;C*joFw)w%Z+C&|q8c3|NeNmnAp$}o9 literal 660 zcmV;F0&D$@4Fm}T0_K>73ipqce(}=j0YrX5rN5m96fxQQDk@#XmdSueCGcF(4<$Ut zle&K#awLB%)IFR6R5odeSWT?^Ixe&7elOxt0~LJx_H3@3-m z=^s_Y#Bkt#u)t6I-#+5+o_IjfX6k6_@<%iQFr}clC_~G5X}j9BY4jUa!sd&W%>RPX z@XCfj{mzh``~Ts~3w-^EJ2n(0aj}GxRzb4l{k_UalH7+e8r1sbJc7XXI2q$jxaWf* zbzkrl^Q)i)MeUz*e(Hmeyb0*y8` zvg!x@)4B1#Z$TI&MMGSg-+Osp4SvTuxP4f1GyEFY)H_UuOfMdKgX^QTJg6D#-$+wd z1nMnu{r~g+8!9}7);q#6bpG(%b{{*<)GRjJsd9?S*GoG!J{7&oeDrEJ2wOjPU~oT| z4lgGD`w1c+piZSIl3=SEs_!Rh>bwY{yns!WsSq=T$F#qFk^DXevz-~TI-CmioFyxu zdqcy7G%6@~*z>wUwDjXf;3j)#Z6Tus&c2FPeUinS`3uacYxy)xUdo>2j}Bs|t>HJq zE;8lE^Of8tx_i0X4gLa_6T75N$rt1gfHRvM+}-MEjI$nJ%VO`y7DSultDnz$Sz+WwW4 zPzfm6U*Vrl(npG6z0`2FJlXL>fIQXAcdggephMn9r)mpQnZ{%0LJWo#J14ILi97k* us9RH-&q{s1ki4PEC>`a}zzIUuBiNeTI_{ltJq z;!#YHmI!~$a%$)*tVb{O>m2-!Dv$!noil8t=fgHhUIy50UZznAOBb88X>;s>k#0P;Z+0MfiLiO z&Y#EU_Rtxc?N*?;dl_oHdPIkWrVdA6yQv!bf@VJRU8i+zr%lRu;wUK zaIjLxc3YWf@W7a5Qg1fDK3oA5C~u*;cKNh*5j;bP&3IQT|%q z^7F8S*x}qgc6UW(A|-Yy!RBZ&{a?Xs?iEUp(uC4r>H=~mEm{mYiM+q-D~&_Km<6Nj6I{IVR8axg{KxPo1eeJY=3? z?DuvSxAx@LCxp-J@VDbDNEJlTW!-bNOqL?L=q* literal 0 HcmV?d00001 diff --git a/occupi-backend/configs/prod.yaml.gpg b/occupi-backend/configs/prod.yaml.gpg index 28fb0392680e30253260007377efca56c9030fa0..37b368289a9a5f75054e944ee23fd8e0cd60ac18 100644 GIT binary patch literal 689 zc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RL~f2;%8kR)!jj46;In|o!DcIb{C|Ka?4&Ni(o zw}hBcDme(x4{VM764dDYcN4dP lt^eM5OpoZPg~Vx3^(Pe^Fwvi;&8(TbW+6{B->aU&*DZWJO&kCK diff --git a/occupi-backend/configs/test.yaml.gpg b/occupi-backend/configs/test.yaml.gpg index 77ee64d384fa777952bd11d53291f4ec29ff04a1..e9596583b003ec8d0903a3fb8402c337a2fdf7fc 100644 GIT binary patch literal 630 zcmV-+0*U>M4Fm}T0y&e-J2O5oYyZ;e0jfAK8GQjU<$?q{BTokUqRq6JL2;@2;fczj zv;qX5Vbu!mQzl3p>ct7~poY=z?Qwl##Xf@MB0%@kjDq6^pu>GZxFiW}@kI;pansiN z_o&Rid)uF>8&lGWe7vp^mHS~T7)~uhRpg8mu;gAolQ0=dLzQzHNW*Q0ZaLL-UDsr@ z0_z2zPh~f4<7$eeo#w14-ja>rq{I85t1giDATqW3z}$aed&=(~HTNh&eNV+cx1wxi zbrb3e-bWMnlIgS|yP zV-H{E($Y*z6uq55v^TAbs3J9Gq<)QLczvsb5U(sHR16kQVWxQ&rggZPo5w;JElR0f zY#PHovul}%>ln7IfY{k_^yoQ`^>UPf?2ac38pLLwH3|Nsj#djTanemcq*=TVnil;* z6q;leyJS>iPQfJM-{#+IG(7kJwe|S!?{OAotCOD#VEPi@lcc8a^ahdSl>(E@EGqXS{3OGB#&bODlugG?uG-A(2 Qwk1ncgxR7s?EnA( literal 591 zcmV-V0w`LeEL-sm48;*+1WS0)Z=#ipS z#vT##*&0LteTEIq#$6+I%ybSg<3oEzdalgplNtsv%AEWHPQ<6Hez#|PRT8@#4EOR} zxzINnK|Nr(U1=RQm}@K2a}2&lPohc!CZv@WPIS*DJtaEK-Qy#JG{rvD1Uxl0-D{L! zVJqzoYFEh(li}tt!08^K{{mS2)g7_)7X*j%lWkb`a{28Gd%Bg{si{8jj?TONB=|zF z0SsnR-bG_c$Yns`@5&JAQ1F6`fhFAaX^z9{{*G^Q5Cqxv?;z5h(DUw}!%V&u&fuk> z^bWs7o1ZU8o>gbogNt-xlBbs(e5PDr$SB3(nob}%c#N@(*l)Nu{87$ZoR6jmh1WQ9 z!o9;c_I}j72W5wS85rlQT69jF%U<|W z*N&RN=o)~NVp*864??sP<$MFoLx-F^;mYy#*6749~}2ZFBH%+Db{W5j!4_s^z%H#Td+ z-zHdG4L?4P#R*9{G1xwIavkviQ;G@X%l6iL{mZU{(o)e1!mcsukMnd@Q({Yg<_Nmx z!#2nES`;%%i0>x_uz7vMJ*j=(mX=Jx0rS@yL$A0mh?ScnU2rt@PD|-4&IM dvfeW{w5DN%{80VvbH?_XQENK7$ diff --git a/occupi-backend/pkg/handlers/auth_handlers.go b/occupi-backend/pkg/handlers/auth_handlers.go index 766785d8..e4c33dcd 100644 --- a/occupi-backend/pkg/handlers/auth_handlers.go +++ b/occupi-backend/pkg/handlers/auth_handlers.go @@ -172,7 +172,7 @@ func Login(ctx *gin.Context, appsession *models.AppSession, role string) { logrus.Error(err) return } - ctx.SetCookie("token", token, int(expirationTime.Unix()), "/", "", false, true) + ctx.SetCookie("token", token, int(time.Until(expirationTime).Seconds()), "/", "", false, true) ctx.JSON(http.StatusOK, utils.SuccessResponse( http.StatusOK,