Skip to content

refactor: get rid of session relation - #17

Open
Ad96el wants to merge 5 commits into
mainfrom
ag_update_session
Open

refactor: get rid of session relation #17
Ad96el wants to merge 5 commits into
mainfrom
ag_update_session

Conversation

@Ad96el

Copy link
Copy Markdown
Contributor

Some minor improvements

Some minor changes. There is no need to store the sessions in the database. Instead, the session data is stored in a session cookie.

Let's hope, it does not break again.

@Ad96el
Ad96el requested a review from abdulmthMay 7, 2024 14:29
Comment on lines +44 to +45
.map_err(|_| AppError::Challenge("Session not set"))?
.ok_or(AppError::Challenge("Session not set"))?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double mapping of error

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get an option after the map_err that's why the ok_or is called. Do you know a smooth way to directly transform it into Result<String, AppError>?

Comment on lines +31 to +32
.map_err(|_| AppError::Challenge("Session not set"))?
.ok_or(AppError::Challenge("Session not set"))?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@Ad96el@abdulmth