Skip to content

Coder tokens erase when session expired, token don't persist with lifetime flag #8169

Closed
@francisco-mata

Description

@francisco-mata

Hi there, are tokens related to a session cookie specific. How can I create a persistent token, to login as user, without having an open session?

Follow this steps:

  1. Login Coder

coder login URL

> Welcome to Coder, coder! You're authenticated.
  1. Create a token for ~6 years
    coder tokens create --lifetime 50000h

  2. Check tokens
    coder tokens list

ID          NAME           LAST USED             EXPIRES AT            CREATED AT            
****     *****  0001-01-01T00:00:00Z  2029-03-06T03:32:19Z  2023-06-22T19:32:19Z 
  1. Logout Coder
    coder logout

  2. Login again
    coder login --token **** URL

> Welcome to Coder, coder! You're authenticated.
  1. Logout Again
    coder logout

  2. Login again
    coder login --token **** URL

You are signed out or your session has expired. Please sign in again to continue.
Try logging in using 'coder login <url>'. 
  1. Login without token, to create a new session
    coder login URL

  2. Chek tokens
    coder tokens list

No tokens found.
                
ID  NAME  LAST USED  EXPIRES AT  CREATED AT`

Metadata

Metadata

Assignees

Labels

must-doIssues that must be completed by the end of the Sprint. Or else. Only humans may set this.s1Bugs that break core workflows. Only humans may set this.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions