Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yda 5550 pam user error message #265

Merged
merged 3 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions user/templates/user/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
{% block title %}{{ super() }} ‐ Sign in{% endblock title %}

{% block content %}
<div
id="alert-user-not-in-instance"
{% if alert_user_not_in_instance is defined and alert_user_not_in_instance %}
class="alert alert-danger alert-dismissible fade show"
{% else %}
class="alert alert-danger alert-dismissible fade hidden"
{% endif %}
role="alert">
Your user is not part of this Yoda instance (yet).
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>

<div class="row">
<div class="offset-md-2 col-md-8">
<div class="card">
Expand Down
21 changes: 20 additions & 1 deletion user/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,18 @@

import jwt
import requests
from flask import Blueprint, current_app as app, flash, g, redirect, render_template, request, Response, session, url_for
from flask import (
Blueprint,
current_app as app,
flash,
g,
redirect,
render_template,
request,
Response,
session,
url_for
)
from irods.exception import CAT_INVALID_AUTHENTICATION, CAT_INVALID_USER, iRODSException, PAM_AUTH_PASSWORD_FAILED
from irods.session import iRODSSession

Expand Down Expand Up @@ -92,6 +103,14 @@ def login() -> Response:
log_error("iRODS authentication failed for user " + username)
return render_template('user/login.html', login_placeholder=get_login_placeholder())

except CAT_INVALID_USER:
log_error("iRODSException CAT_INVALID_USER for login of user " + str(username), True)
return render_template(
'user/login.html',
login_placeholder=get_login_placeholder(),
alert_user_not_in_instance=True
)

except iRODSException:
flash(
'An error occurred while connecting to iRODS. '
Expand Down
2 changes: 1 addition & 1 deletion vault/static/vault/js/vault.js
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ function topInformation (dir, showAlert) {
{ quiet: true, rawResult: true }).then((dataRaw) => {
const data = dataRaw.data
if (dataRaw.status === 'error_nonexistent') {
Yoda.set_message('error', 'This vault space path does not exists: ' + dir)
Yoda.set_message('error', 'This vault space path does not exist: ' + dir)
$('#file-browser_wrapper').addClass('hide')
$('.top-information').addClass('hide')

Expand Down
Loading