(s string)
| 621 | } |
| 622 | |
| 623 | func parseTfaRememberDuration(s string) time.Duration { |
| 624 | s = strings.TrimSpace(strings.ToLower(s)) |
| 625 | if len(s) < 2 { |
| 626 | return 30 * 24 * time.Hour |
| 627 | } |
| 628 | n, err := strconv.Atoi(s[:len(s)-1]) |
| 629 | if err != nil || n <= 0 { |
| 630 | return 30 * 24 * time.Hour |
| 631 | } |
| 632 | switch s[len(s)-1] { |
| 633 | case 'd': |
| 634 | return time.Duration(n) * 24 * time.Hour |
| 635 | case 'h': |
| 636 | return time.Duration(n) * time.Hour |
| 637 | case 'm': |
| 638 | return time.Duration(n) * time.Minute |
| 639 | default: |
| 640 | return 30 * 24 * time.Hour |
| 641 | } |
| 642 | } |
| 643 | |
| 644 | // CompleteOidcLogin creates tokens, sets cookies (SameSite=Lax for IdP redirects), and redirects to success. |
| 645 | // Used by OIDC callback after successful authentication. |
no outgoing calls
no test coverage detected